Example #1
0
 def test_with_user_name(self):
     d = Deployment('test', 'Function', ConfigTree({
         'context': 'foo',
         'path': 'test-name.jar'
     }), '0.0.1')
     d.with_user('test_name')
     self.assertEqual(d.name, 'test_name_test')
     self.assertEqual(d.data['path'], 'test_name_test-name.jar')
     self.assertEqual(d.data['context'], 'test_name_foo')
Example #2
0
    def parse_deployment(deployment_conf):

        cfg = ConfigFactory.parse_file(deployment_conf)
        model_type = cfg['model']
        name = cfg.get_string(
            'name', os.path.basename(os.path.dirname(deployment_conf)))
        version = None
        if model_type == 'Artifact':
            version = cfg['version']
        order = MistApp.__safe_get_order(deployment_conf)

        return order, Deployment(name, model_type,
                                 cfg.get_config('data', ConfigTree()), version)
Example #3
0
 def test_create_deployment(self):
     Deployment('test', 'Artifact', ConfigTree(), '0.0.1')
Example #4
0
 def test_get_name(self):
     d = Deployment('test', 'Artifact', ConfigTree({
         'file-path': 'test-name.py'
     }), '0.0.1')
     self.assertEqual(d.get_name(), 'test_0.0.1.py')