Skip to content

Commit

Permalink
Namespace updates to unit tests due to refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
anbeemer committed Jul 24, 2024
1 parent 39bb759 commit 7eb0184
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 26 deletions.
10 changes: 5 additions & 5 deletions test/test_assignment.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
8 changes: 4 additions & 4 deletions test/test_droplets.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)



Expand Down
10 changes: 5 additions & 5 deletions test/test_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
8 changes: 4 additions & 4 deletions test/test_link_to_local_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)



16 changes: 8 additions & 8 deletions test/test_page_in_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)



Expand All @@ -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)
Expand All @@ -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))

0 comments on commit 7eb0184

Please sign in to comment.