def test_duplicate_user(self): with open(test_filepath, 'w') as f: content = ["user2 ", "user3\n", users[0][0]] f.writelines(content) self.assertFalse(GroupManager.create_groups(filepath=test_filepath))
def create_groups(group_count=0, users_per_group=0, filepath=None): return GroupManager.create_groups(group_count, users_per_group, filepath)
def test_whitespace(self): with open(test_filepath, 'w') as f: f.write(" ") self.assertFalse(GroupManager.create_groups(filepath=test_filepath))
def test_nonexistent(self): self.assertFalse(GroupManager.create_groups(filepath="notafile.txt"))
def setUp(self): global start_id start_id = get_next_id() GroupManager.create_groups(1, 2)
def test_create_groups(self): global start_id start_id = get_next_id() self.assertTrue(GroupManager.create_groups(group_count, user_count))
def test_import(self): with open(test_filepath, 'w') as f: f.writelines(file_content) self.assertTrue(GroupManager.create_groups(filepath=test_filepath))