Skip to content
Snippets Groups Projects

L2SS-1067: Assert version from VERSION file for tests

Merged L2SS-1067: Assert version from VERSION file for tests
Merged Corné Lukken requested to merge L2SS-1067 into master
1 file
+ 13
1
Compare changes
  • Side-by-side
  • Inline
@@ -15,6 +15,7 @@ from tangostationcontrol.statistics import reader
@@ -15,6 +15,7 @@ from tangostationcontrol.statistics import reader
from tangostationcontrol.statistics.writer import entry
from tangostationcontrol.statistics.writer import entry
import sys
import sys
 
from os import getcwd
from os.path import dirname, isfile, join
from os.path import dirname, isfile, join
from tempfile import TemporaryDirectory
from tempfile import TemporaryDirectory
from unittest import mock
from unittest import mock
@@ -25,6 +26,10 @@ import numpy
@@ -25,6 +26,10 @@ import numpy
class TestStatisticsWriterSST(BaseIntegrationTestCase):
class TestStatisticsWriterSST(BaseIntegrationTestCase):
 
# Assume project root is current working directory
 
# Should always be true due to tox
 
VERSION_FILE_PATH = getcwd() + "/VERSION"
 
RECV_PROXY_STRING = "STAT/RECV/1"
RECV_PROXY_STRING = "STAT/RECV/1"
def setUp(self):
def setUp(self):
@@ -81,8 +86,15 @@ class TestStatisticsWriterSST(BaseIntegrationTestCase):
@@ -81,8 +86,15 @@ class TestStatisticsWriterSST(BaseIntegrationTestCase):
stat = stat_parser.get_statistic(
stat = stat_parser.get_statistic(
'2021-09-20T12:17:40.000+00:00'
'2021-09-20T12:17:40.000+00:00'
)
)
 
 
# Open VERSION file
 
version_file = open(self.VERSION_FILE_PATH, "rt")
 
self.assertIsNotNone(stat)
self.assertIsNotNone(stat)
self.assertEqual("0.5.0", stat.station_version_id)
# Remove last character, should be \n as asserted by CI/CD
 
self.assertEqual(
 
version_file.readline()[:-1], stat.station_version_id
 
)
self.assertEqual("0.1", stat.writer_version_id)
self.assertEqual("0.1", stat.writer_version_id)
def test_insert_tango_SST_statistics(self):
def test_insert_tango_SST_statistics(self):
Loading