Skip to content

Commit

Permalink
Improving test
Browse files Browse the repository at this point in the history
  • Loading branch information
humbleOldSage committed Jan 10, 2024
1 parent a32ce4f commit 052cb08
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions emission/tests/modellingTests/TestForestModelIntegration.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import emission.storage.timeseries.timequery as estt
import emission.core.get_database as edb
import emission.tests.common as etc
import emission.pipeline.intake_stage as epi
import logging

class TestLabelInferencePipeline(unittest.TestCase):
Expand All @@ -32,20 +33,22 @@ def tearDown(self):
def run_pipeline(self, algorithms):
default_primary_algorithms = eacilp.primary_algorithms
eacilp.primary_algorithms = algorithms
etc.runIntakePipeline(self.testUUID)
epi.run_intake_pipeline_for_user(self.testUUID,skip_if_no_new_data = False)
eacilp.primary_algorithms = default_primary_algorithms

def reset_all(self):
etc.dropAllCollections(edb._get_current_db())

# Tests that each of the (test) algorithms runs and saves to the database correctly
# Tests that algorithm being tested runs and saves to the database correctly
def testIndividualAlgorithms(self):
logging.debug('TEST1')
for trip in self.inferred_trips:
entries = esdt.get_sections_for_trip("inference/labels", self.testUUID, trip.get_id())
logging.debug(f"ENTRIES: {entries}")
self.assertEqual(len(entries), len(self.test_algorithms))
for entry in entries:
self.assertGreater(len(entry["data"]["prediction"]), 0)

# for entry in entries:
# self.assertGreater(len(entry["data"]["prediction"]), 0)

def main():
etc.configLogging()
Expand Down

0 comments on commit 052cb08

Please sign in to comment.