From 7eb01847351788d9695895907ab44160cde3f754 Mon Sep 17 00:00:00 2001 From: Allison Beemer <66966224+anbeemer@users.noreply.github.com> Date: Tue, 23 Jul 2024 21:33:09 -0500 Subject: [PATCH] Namespace updates to unit tests due to refactor --- test/test_assignment.py | 10 +++++----- test/test_droplets.py | 8 ++++---- test/test_image.py | 10 +++++----- test/test_link_to_local_file.py | 8 ++++---- test/test_page_in_module.py | 16 ++++++++-------- 5 files changed, 26 insertions(+), 26 deletions(-) diff --git a/test/test_assignment.py b/test/test_assignment.py index 5b616b3..85dde44 100644 --- a/test/test_assignment.py +++ b/test/test_assignment.py @@ -46,12 +46,12 @@ def test_can_publish(self, course, assignment): def test_can_find_published(self, course, assignment): assignment.publish(course,overwrite=True) - assert mc.is_assignment_already_uploaded(assignment.name,course) + assert mc.course_interaction_functions.is_assignment_already_uploaded(assignment.name,course) def test_published_has_properties(self, course, assignment): assignment.publish(course,overwrite=True) - on_canvas = mc.find_assignment_in_course(assignment.name,course) + on_canvas = mc.course_interaction_functions.find_assignment_in_course(assignment.name,course) assert on_canvas.points_possible == assignment.points_possible assert 'jpg' in on_canvas.allowed_extensions @@ -71,8 +71,8 @@ def test_doesnt_find_deleted(self, course, assignment): name = assignment.name assignment.publish(course,overwrite=True) - assert mc.is_assignment_already_uploaded(name,course) - f = mc.find_assignment_in_course(name,course) + assert mc.course_interaction_functions.is_assignment_already_uploaded(name,course) + f = mc.course_interaction_functions.find_assignment_in_course(name,course) f.delete() # print([i.name for i in course.get_assignments()]) - assert not mc.is_assignment_already_uploaded(name,course) + assert not mc.course_interaction_functions.is_assignment_already_uploaded(name,course) diff --git a/test/test_droplets.py b/test/test_droplets.py index ca69255..7170bd8 100644 --- a/test/test_droplets.py +++ b/test/test_droplets.py @@ -57,17 +57,17 @@ def test_doesnt_find_deleted(self, course, page): name = page.name page.publish(course,overwrite=True) - assert mc.is_page_already_uploaded(name,course) - f = mc.find_page_in_course(name,course) + assert mc.course_interaction_functions.is_page_already_uploaded(name,course) + f = mc.course_interaction_functions.find_page_in_course(name,course) f.delete() # print([i.name for i in course.get_pages()]) - assert not mc.is_page_already_uploaded(name,course) + assert not mc.course_interaction_functions.is_page_already_uploaded(name,course) def test_can_find_published(self, course, page): page.publish(course,overwrite=True) - assert mc.is_page_already_uploaded(page.name,course) + assert mc.course_interaction_functions.is_page_already_uploaded(page.name,course) diff --git a/test/test_image.py b/test/test_image.py index 9d4f0b3..349ab76 100644 --- a/test/test_image.py +++ b/test/test_image.py @@ -40,20 +40,20 @@ def test_can_publish_image(self, course, image): def test_can_find_published_image(self, course, image): image.publish(course,'images',overwrite=True) - assert mc.is_file_already_uploaded(file_to_publish,course) + assert mc.course_interaction_functions.is_file_already_uploaded(file_to_publish,course) def test_doesnt_find_deleted_image(self, course, image): image.publish(course,'images',overwrite=True) - assert mc.is_file_already_uploaded(file_to_publish,course) - f = mc.find_file_in_course(file_to_publish,course) + assert mc.course_interaction_functions.is_file_already_uploaded(file_to_publish,course) + f = mc.course_interaction_functions.find_file_in_course(file_to_publish,course) f.delete() - assert not mc.is_file_already_uploaded(file_to_publish,course) + assert not mc.course_interaction_functions.is_file_already_uploaded(file_to_publish,course) def test_can_get_already_published_image(self, course, image): # first, definitely publish image.publish(course,'images',overwrite=True) - img_on_canvas = mc.find_file_in_course(file_to_publish,course) + img_on_canvas = mc.course_interaction_functions.find_file_in_course(file_to_publish,course) assert img_on_canvas.filename == filename diff --git a/test/test_link_to_local_file.py b/test/test_link_to_local_file.py index 4dbb790..a63d956 100644 --- a/test/test_link_to_local_file.py +++ b/test/test_link_to_local_file.py @@ -60,17 +60,17 @@ def test_doesnt_find_deleted(self, course, page): name = page.name page.publish(course,overwrite=True) - assert mc.is_page_already_uploaded(name,course) - f = mc.find_page_in_course(name,course) + assert mc.course_interaction_functions.is_page_already_uploaded(name,course) + f = mc.course_interaction_functions.find_page_in_course(name,course) f.delete() # print([i.name for i in course.get_pages()]) - assert not mc.is_page_already_uploaded(name,course) + assert not mc.course_interaction_functions.is_page_already_uploaded(name,course) def test_can_find_published(self, course, page): page.publish(course,overwrite=True) - assert mc.is_page_already_uploaded(page.name,course) + assert mc.course_interaction_functions.is_page_already_uploaded(page.name,course) diff --git a/test/test_page_in_module.py b/test/test_page_in_module.py index 9e50f94..cebe368 100644 --- a/test/test_page_in_module.py +++ b/test/test_page_in_module.py @@ -33,7 +33,7 @@ def destination_modules(page_plain_text_in_a_module): def _delete_test_modules(course, destination_modules): for m in destination_modules: - mc.delete_module(m, course, even_if_doesnt_exist=True) + mc.course_interaction_functions.delete_module(m, course, even_if_doesnt_exist=True) @@ -58,23 +58,23 @@ def test_already_online_raises(self, course, page_plain_text_in_a_module): def test_can_make_modules(self, course, destination_modules): for m in destination_modules: - mc.create_or_get_module(m,course) + mc.course_interaction_functions.create_or_get_module(m,course) def test_can_delete_modules(self, course, destination_modules): _delete_test_modules(course, destination_modules) for m in destination_modules: - mc.create_or_get_module(m,course) + mc.course_interaction_functions.create_or_get_module(m,course) for m in destination_modules: - mc.delete_module(m, course, even_if_doesnt_exist=False) + mc.course_interaction_functions.delete_module(m, course, even_if_doesnt_exist=False) def test_page_in_module_after_publishing(self, course, page_plain_text_in_a_module, destination_modules): page_plain_text_in_a_module.publish(course,overwrite=True) - assert mc.is_page_already_uploaded(page_plain_text_in_a_module.name,course) + assert mc.course_interaction_functions.is_page_already_uploaded(page_plain_text_in_a_module.name,course) page_plain_text_in_a_module.ensure_in_modules(course) @@ -89,15 +89,15 @@ def test_page_in_module_after_publishing(self, course, page_plain_text_in_a_modu # name = self.page.name # self.page.publish(self.course,overwrite=True) - # self.assertTrue(mc.is_page_already_uploaded(name,self.course)) + # self.assertTrue(mc.course_interaction_functions.is_page_already_uploaded(name,self.course)) # f = mc.find_page_in_course(name,self.course) # f.delete() # # print([i.name for i in self.course.get_pages()]) - # self.assertTrue(not mc.is_page_already_uploaded(name,self.course)) + # self.assertTrue(not mc.course_interaction_functions.is_page_already_uploaded(name,self.course)) # def test_zzz_can_find_published(self): # self.page.publish(self.course,overwrite=True) - # self.assertTrue(mc.is_page_already_uploaded(self.page.name,self.course)) + # self.assertTrue(mc.course_interaction_functions.is_page_already_uploaded(self.page.name,self.course))