Commit 1808893a708d65a4263594e8bed40a19a0dbcf08

Authored by Unknown
1 parent 56b06950
Exists in dev

Fixing typo and commenting obsolete test

Showing 2 changed files with 48 additions and 48 deletions   Show diff stats
src/alert_manager/tests.py
... ... @@ -58,50 +58,50 @@ class TestStrategyChange(TestCase):
58 58 self.assertEqual(new_alert.strategyobs.id, self.strat2.id, "The new alert should have the 'strat2' strategy")
59 59  
60 60 # OBSOLETE
61   -class AlertListenerTestsCelery(TestCase):
62   - '''
63   - IMPORTANT : As soon as you do a DB request in a test, the test DB will no longer be synchronized with the DB used by celery
64   - I have no idea why (Paul), but any call to the DB must be done in setup or after all celery actions are finished
65   - '''
66   -
67   - def test_alert_reception(self):
68   - '''
69   - Must be launched with scripts/celery_test.sh
70   - Copy a VOEvent file in the events_received directory to start the workflow
71   - Tests if the alert and children are well created
72   - '''
73   -
74   -
75   - if os.path.isfile(TEST_FILE_PATH):
76   - os.remove(TEST_FILE_PATH)
77   - print("================== DELETE FILE ==================")
78   - time.sleep(3)
79   -
80   - print("================== COPY FILE ==================")
81   - shutil.copyfile(os.path.join(VOEVENTS_TO_SEND_PATH, TEST_FILE),
82   - TEST_FILE_PATH)
83   - time.sleep(4)
84   -
85   - self.assertEqual(Alert.objects.count(), 1)
86   - alert = Alert.objects.all()[0]
87   - self.assertEqual(alert.author, "ivo://nasa.gsfc.tan/gcn")
88   - self.assertEqual(alert.burst_ra, 74.7412)
89   - self.assertEqual(alert.burst_dec, 25.3137)
90   - self.assertEqual(alert.trig_id, 532871)
91   - self.assertEqual(alert.editor, "61")
92   - self.assertEqual(alert.pkt_ser_num, 1)
93   -
94   - self.assertEqual(Request.objects.count(), 1)
95   - self.assertEqual(Sequence.objects.count(), 2)
96   - self.assertEqual(Album.objects.count(), 3)
97   - self.assertEqual(Plan.objects.count(), 6)
98   -
99   -
100   -
101   - def test_basic(self):
102   - '''
103   - Used to test scripts/celery_test.sh
104   - Only work if the initial_fixture is on the celery test DB (an only it)
105   - '''
106   - Country.objects.create(name="TEEEEST")
107   - self.assertEqual(Country.objects.count(), 2, "should be 2 countries")
  61 +# class AlertListenerTestsCelery(TestCase):
  62 +# '''
  63 +# IMPORTANT : As soon as you do a DB request in a test, the test DB will no longer be synchronized with the DB used by celery
  64 +# I have no idea why (Paul), but any call to the DB must be done in setup or after all celery actions are finished
  65 +# '''
  66 +#
  67 +# def test_alert_reception(self):
  68 +# '''
  69 +# Must be launched with scripts/celery_test.sh
  70 +# Copy a VOEvent file in the events_received directory to start the workflow
  71 +# Tests if the alert and children are well created
  72 +# '''
  73 +#
  74 +#
  75 +# if os.path.isfile(TEST_FILE_PATH):
  76 +# os.remove(TEST_FILE_PATH)
  77 +# print("================== DELETE FILE ==================")
  78 +# time.sleep(3)
  79 +#
  80 +# print("================== COPY FILE ==================")
  81 +# shutil.copyfile(os.path.join(VOEVENTS_TO_SEND_PATH, TEST_FILE),
  82 +# TEST_FILE_PATH)
  83 +# time.sleep(4)
  84 +#
  85 +# self.assertEqual(Alert.objects.count(), 1)
  86 +# alert = Alert.objects.all()[0]
  87 +# self.assertEqual(alert.author, "ivo://nasa.gsfc.tan/gcn")
  88 +# self.assertEqual(alert.burst_ra, 74.7412)
  89 +# self.assertEqual(alert.burst_dec, 25.3137)
  90 +# self.assertEqual(alert.trig_id, 532871)
  91 +# self.assertEqual(alert.editor, "61")
  92 +# self.assertEqual(alert.pkt_ser_num, 1)
  93 +#
  94 +# self.assertEqual(Request.objects.count(), 1)
  95 +# self.assertEqual(Sequence.objects.count(), 2)
  96 +# self.assertEqual(Album.objects.count(), 3)
  97 +# self.assertEqual(Plan.objects.count(), 6)
  98 +#
  99 +#
  100 +#
  101 +# def test_basic(self):
  102 +# '''
  103 +# Used to test scripts/celery_test.sh
  104 +# Only work if the initial_fixture is on the celery test DB (an only it)
  105 +# '''
  106 +# Country.objects.create(name="TEEEEST")
  107 +# self.assertEqual(Country.objects.count(), 2, "should be 2 countries")
... ...
src/pyros/test_settings.py
1 1 """ OBSOLETE FILE """
2   -"""
  2 +"""
3 3 Django settings for pyros project.
4 4  
5 5 Generated by 'django-admin startproject' using Django 1.9.4.
... ...