Skip to content
Permalink
Browse files

Copy over the simple 2 result vector seed model before running the tests

Using a standard, albeit fake, model will:
- give predictable results
- allow full system testing

But no model will cause the inference step, and by extension, some tests, to fail
  • Loading branch information...
shankari committed Feb 24, 2018
1 parent 284861c commit b390ee00a58bcd02acad891b11f4a476cec3c517
@@ -12,6 +12,7 @@
import json
import geojson as gj
import bson.json_util as bju
import os

# Our imports
import emission.core.get_database as edb
@@ -38,15 +39,18 @@

class TestGeojsonFeatureConverter(unittest.TestCase):
def setUp(self):
self.copied_model_path = etc.copy_dummy_seed_for_inference()
etc.setupRealExample(self, "emission/tests/data/real_examples/shankari_2015-aug-27")
eaicf.filter_accuracy(self.testUUID)

def tearDown(self):
self.clearRelatedDb()
os.remove(self.copied_model_path)

def clearRelatedDb(self):
edb.get_timeseries_db().delete_many({"user_id": self.testUUID})
edb.get_analysis_timeseries_db().delete_many({"user_id": self.testUUID})
os.remove(self.copied_model_path)

def testTripGeojson(self):
eaist.segment_current_trips(self.testUUID)
@@ -212,3 +212,10 @@ def set_analysis_config(key, value):
# Return this so that we can delete it in the teardown
return analysis_conf_path

def copy_dummy_seed_for_inference():
import shutil

seed_json_source = "emission/tests/data/seed_model_from_test_data.json"
seed_json_dest = "seed_model.json"
shutil.copyfile(seed_json_source, seed_json_dest)
return seed_json_dest

0 comments on commit b390ee0

Please sign in to comment.
You can’t perform that action at this time.