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