Esempio 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))
Esempio 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)
Esempio n. 3
0
 def test_nonexistent(self):
     self.assertFalse(GroupManager.create_groups(filepath="notafile.txt"))
Esempio n. 4
0
 def test_whitespace(self):
     with open(test_filepath, 'w') as f:
         f.write("          ")
     self.assertFalse(GroupManager.create_groups(filepath=test_filepath))
Esempio n. 5
0
 def update_user(username, updated_user):
     return GroupManager.update_user(username, updated_user)
Esempio n. 6
0
 def test_import(self):
     with open(test_filepath, 'w') as f:
         f.writelines(file_content)
     self.assertTrue(GroupManager.create_groups(filepath=test_filepath))
Esempio n. 7
0
 def test_change_id(self):
     self.assertFalse(
         GroupManager.update_group(start_id, Group(**updated_group)))
Esempio n. 8
0
 def attach_platform(group_id, platform_name):
     return GroupManager.attach_platform(group_id, platform_name)
Esempio n. 9
0
 def tearDown(self):
     GroupManager.delete_group(start_id)
Esempio n. 10
0
 def test_update_nonexistent(self):
     self.assertFalse(GroupManager.update_group(102,
                                                Group(**updated_group)))
Esempio n. 11
0
 def setUp(self):
     global start_id
     start_id = get_next_id()
     GroupManager.create_groups(1, 2)
Esempio n. 12
0
 def test_create_groups(self):
     global start_id
     start_id = get_next_id()
     self.assertTrue(GroupManager.create_groups(group_count, user_count))
Esempio n. 13
0
 def tearDown(self):
     for i in range(group_count):
         GroupManager.delete_group(start_id + i)
Esempio n. 14
0
 def update_group(group_id, updated_group):
     return GroupManager.update_group(group_id, updated_group)
Esempio n. 15
0
 def test_group_delete(self):
     self.assertTrue(GroupManager.delete_group(1000))
Esempio n. 16
0
 def delete_group(group_id):
     return GroupManager.delete_group(group_id)
Esempio n. 17
0
 def test_group_delete(self):
     GroupManager.delete_group(1000)
     self.assertIsNone(get_group(1000))
Esempio n. 18
0
 def detach_platform(platform_name):
     return GroupManager.detach_platform(platform_name)
Esempio n. 19
0
 def tearDown(self):
     GroupManager.delete_group(1000)
Esempio n. 20
0
 def delete_user(username):
     return GroupManager.delete_user(username)
Esempio n. 21
0
 def tearDown(self):
     for line in file_users():
         current = get_user(line[0]).group_id
         GroupManager.delete_group(current)