예제 #1
0
 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))
예제 #2
0
 def create_groups(group_count=0, users_per_group=0, filepath=None):
     return GroupManager.create_groups(group_count, users_per_group,
                                       filepath)
예제 #3
0
 def test_whitespace(self):
     with open(test_filepath, 'w') as f:
         f.write("          ")
     self.assertFalse(GroupManager.create_groups(filepath=test_filepath))
예제 #4
0
 def test_nonexistent(self):
     self.assertFalse(GroupManager.create_groups(filepath="notafile.txt"))
예제 #5
0
 def setUp(self):
     global start_id
     start_id = get_next_id()
     GroupManager.create_groups(1, 2)
예제 #6
0
 def test_create_groups(self):
     global start_id
     start_id = get_next_id()
     self.assertTrue(GroupManager.create_groups(group_count, user_count))
예제 #7
0
 def test_import(self):
     with open(test_filepath, 'w') as f:
         f.writelines(file_content)
     self.assertTrue(GroupManager.create_groups(filepath=test_filepath))