Skip to content

Commit 99ae4d1

Browse files
Created unit test case file for classroom snippet API. (googleworkspace#292)
* Created unit test case file for classroom snippet API. * Update test_classroom_create_course.py * Update test_classroom_create_course.py * Update test_classroom_list_courses.py * Update test_classroom_get_course.py * Update test_classroom_get_course.py * Created unit test case file for classroom snippet API. Co-authored-by: himanshupr2627 <[email protected]>
1 parent a5c92d5 commit 99ae4d1

5 files changed

Lines changed: 153 additions & 0 deletions
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
"""
2+
Copyright 2022 Google LLC
3+
Licensed under the Apache License, Version 2.0 (the "License");
4+
you may not use this file except in compliance with the License.
5+
You may obtain a copy of the License at
6+
http://www.apache.org/licenses/LICENSE-2.0
7+
Unless required by applicable law or agreed to in writing, software
8+
distributed under the License is distributed on an "AS IS" BASIS,
9+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10+
See the License for the specific language governing permissions and
11+
limitations under the License.
12+
"""
13+
14+
import unittest
15+
16+
import classroom_create_course
17+
18+
19+
class TestClassroomCreateCourse(unittest.TestCase):
20+
"""Unit test class for Create course snippet"""
21+
@classmethod
22+
def test_classroom_create_course(cls):
23+
"""Class function for Create course snippet"""
24+
course = classroom_create_course.classroom_create_course()
25+
cls.assertIsNotNone(cls, course)
26+
cls.doClassCleanups()
27+
28+
29+
if __name__ == "__main__":
30+
unittest.main()
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
"""
2+
Copyright 2022 Google LLC
3+
Licensed under the Apache License, Version 2.0 (the "License");
4+
you may not use this file except in compliance with the License.
5+
You may obtain a copy of the License at
6+
http://www.apache.org/licenses/LICENSE-2.0
7+
Unless required by applicable law or agreed to in writing, software
8+
distributed under the License is distributed on an "AS IS" BASIS,
9+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10+
See the License for the specific language governing permissions and
11+
limitations under the License.
12+
"""
13+
14+
15+
import unittest
16+
17+
import classroom_get_course
18+
import classroom_list_courses
19+
20+
21+
class TestClassroomGetCourse(unittest.TestCase):
22+
"""Unit test class for Get course snippet"""
23+
@classmethod
24+
def test_classroom_get_course(cls):
25+
"""Unit test method for Get course snippet"""
26+
course = classroom_list_courses.classroom_list_courses()
27+
course_id = classroom_get_course.classroom_get_course(course.get(
28+
'id'))
29+
cls.assertIsNotNone(cls, course_id)
30+
31+
32+
if __name__ == "__main__":
33+
unittest.main()
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
"""
2+
Copyright 2022 Google LLC
3+
Licensed under the Apache License, Version 2.0 (the "License");
4+
you may not use this file except in compliance with the License.
5+
You may obtain a copy of the License at
6+
http://www.apache.org/licenses/LICENSE-2.0
7+
Unless required by applicable law or agreed to in writing, software
8+
distributed under the License is distributed on an "AS IS" BASIS,
9+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10+
See the License for the specific language governing permissions and
11+
limitations under the License.
12+
"""
13+
import unittest
14+
15+
import classroom_list_courses
16+
17+
18+
class TestClassroomListCourses(unittest.TestCase):
19+
"""Unit test class for List course snippet"""
20+
@classmethod
21+
def test_classroom_create_course(cls):
22+
"""Unit test method for List course snippet"""
23+
course = classroom_list_courses.classroom_list_courses()
24+
cls.assertIsNotNone(cls, course)
25+
26+
27+
if __name__ == "__main__":
28+
unittest.main()
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
"""
2+
Copyright 2022 Google LLC
3+
Licensed under the Apache License, Version 2.0 (the "License");
4+
you may not use this file except in compliance with the License.
5+
You may obtain a copy of the License at
6+
http://www.apache.org/licenses/LICENSE-2.0
7+
Unless required by applicable law or agreed to in writing, software
8+
distributed under the License is distributed on an "AS IS" BASIS,
9+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10+
See the License for the specific language governing permissions and
11+
limitations under the License.
12+
"""
13+
import unittest
14+
15+
import classroom_list_courses
16+
import classroom_patch_course
17+
18+
19+
class TestClassroomPatchCourse(unittest.TestCase):
20+
"""Unit test class for Patch course snippet"""
21+
@classmethod
22+
def test_classroom_patch_course(cls):
23+
"""Unit test method for Patch course snippet"""
24+
course = classroom_list_courses.classroom_list_courses()
25+
course_id = classroom_patch_course.classroom_patch_course(course
26+
.get('id'))
27+
cls.assertIsNotNone(cls, course_id)
28+
29+
30+
if __name__ == '__main__':
31+
unittest.main()
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
"""
2+
Copyright 2022 Google LLC
3+
Licensed under the Apache License, Version 2.0 (the "License");
4+
you may not use this file except in compliance with the License.
5+
You may obtain a copy of the License at
6+
http://www.apache.org/licenses/LICENSE-2.0
7+
Unless required by applicable law or agreed to in writing, software
8+
distributed under the License is distributed on an "AS IS" BASIS,
9+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10+
See the License for the specific language governing permissions and
11+
limitations under the License.
12+
"""
13+
import unittest
14+
15+
import classroom_list_courses
16+
import classroom_update_course
17+
18+
19+
class TestClassroomUpdateCourse(unittest.TestCase):
20+
"""Unit test class for Get course snippet"""
21+
@classmethod
22+
def test_classroom_update_course(cls):
23+
"""Unit test method for Get course snippet"""
24+
course = classroom_list_courses.classroom_list_courses()
25+
course_id = classroom_update_course.classroom_update_course(course
26+
.get('id'))
27+
cls.assertIsNotNone(cls, course_id)
28+
29+
30+
if __name__ == "__main__":
31+
unittest.main()

0 commit comments

Comments
 (0)