예제 #1
0
 def test_get_sync_mobile_states_superuser_with_sync_mobile_fail(self, mocked_stdout, command):
     self.client.login(username='******', password='******')
     if os.path.exists(os.path.join('var', 'tmp_sync_mobile')):
         shutil.rmtree(os.path.join('var', 'tmp_sync_mobile'))
     launch_sync_mobile.apply()
     response = self.client.post(reverse('apimobile:sync_mobiles_state'), data={})
     self.assertEqual(response.status_code, 200)
     self.assertIn(b'"exc_message": "This is a test"', response.content)
예제 #2
0
 def test_launch_sync_rando_no_rando_root(self, mocked_stdout, command):
     if os.path.exists('tmp'):
         shutil.rmtree('tmp')
     task = launch_sync_mobile.apply()
     log = mocked_stdout.getvalue()
     self.assertNotIn("Done", log)
     self.assertNotIn('Sync mobile ended', log)
     self.assertEqual(task.status, "FAILURE")
예제 #3
0
 def test_launch_sync_mobile(self, mocked_stdout):
     if os.path.exists(os.path.join('var', 'tmp_sync_mobile')):
         shutil.rmtree(os.path.join('var', 'tmp_sync_mobile'))
     task = launch_sync_mobile.apply()
     log = mocked_stdout.getvalue()
     self.assertIn("Done", log)
     self.assertIn('Sync mobile ended', log)
     self.assertEqual(task.status, "SUCCESS")
     if os.path.exists(os.path.join('var', 'tmp_sync_mobile')):
         shutil.rmtree(os.path.join('var', 'tmp_sync_mobile'))
예제 #4
0
 def test_launch_sync_mobile_fail(self, mocked_stdout, command):
     task = launch_sync_mobile.apply()
     log = mocked_stdout.getvalue()
     self.assertNotIn("Done", log)
     self.assertNotIn('Sync mobile ended', log)
     self.assertEqual(task.status, "FAILURE")