def setUp(self): """stuff""" # NOTE these lines could just be performed by builder once that's # set up # Setup environment self.env = EnvironmentConfig.create_from_filepath( self.ENVIRONMENT_FILEPATH) self.env.set_environment() # Setup config config = SqlSchemaConfig.create_from_filepath(self.SCHEMA_FILEPATH, environment=self.env) self.schema = config.create(etl_classes=postgresql_schema)
def test_set_environment(self): # NOTE expected environment depends on what is set in the fixture config # At the moment, the expected environment is just the default values of # each environment setting. A more comprehensive test would actually # set environment variables and files to test expected_environment = {"A": 0, "B": 1, "C": 2} config_filepath = os.path.join(os.path.dirname(__file__), "fixtures", "environment.json") config = EnvironmentConfig.create_from_filepath(config_filepath) config.set_environment() self.assertEqual(config.environment, expected_environment)
def setUp(self): """stuff""" # NOTE these lines could just be performed by builder once that's # set up # Setup environment self.env = EnvironmentConfig.create_from_filepath( self.ENVIRONMENT_FILEPATH ) self.env.set_environment() self.data = json.load(open(self.DATA_FILEPATH)) # Setup config config = SqlSchemaConfig.create_from_filepath(self.SCHEMA_FILEPATH, environment=self.env) self.schema = config.create(etl_classes=mysql_schema)
def test_set_environment(self): # NOTE expected environment depends on what is set in the fixture config # At the moment, the expected environment is just the default values of # each environment setting. A more comprehensive test would actually # set environment variables and files to test expected_environment = {"A": 0, "B": 1, "C": 2} config_filepath = os.path.join( os.path.dirname(__file__), "fixtures", "environment.json" ) config = EnvironmentConfig.create_from_filepath(config_filepath) config.set_environment() self.assertEqual(config.environment, expected_environment)