Beispiel #1
0
 def test_metrics_should_be_delegated_from_ingredients(self):
     recipe = Recipe.builder().ingredients({
         'metrics': {
             'enabled': True
         }
     }).build()
     assert recipe.metrics()['enabled'] is True
Beispiel #2
0
 def test_admin_privileges_should_be_delegated_from_ingredients(self):
     recipe = Recipe.builder().ingredients({
         'adminPrivileges': {
             'enabled': True
         }
     }).build()
     assert recipe.admin_privileges()['enabled'] is True
Beispiel #3
0
 def test_ports_should_delegate_from_ingredients(self):
     recipe = Recipe.builder().ingredients({
         'ports': [{
             'name': 'kuku'
         }]
     }).build()
     assert recipe.ports()[0]['name'] == 'kuku'
Beispiel #4
0
 def test_ingress_should_be_delegate_from_ingredients(self):
     recipe = Recipe.builder().ingredients({
         'ingress': {
             'enabled': True,
             'host': 'service-ingress.io'
         }
     }).build()
     assert recipe.ingress()['enabled'] is True
     assert recipe.ingress()['host'] is 'service-ingress.io'
Beispiel #5
0
 def test_autoscale_should_be_delegate_from_ingredients(self):
     recipe = Recipe.builder().ingredients({
         'autoscale': {
             'enabled': True,
             'cpu': 'low'
         }
     }).build()
     assert recipe.autoscale()['enabled'] is True
     assert recipe.autoscale()['cpu'] is 'low'
Beispiel #6
0
 def test_ingress_should_be_disabled_by_default(self):
     recipe = Recipe.builder().build()
     assert recipe.ingress()['enabled'] is False
Beispiel #7
0
 def test_expose_should_be_delegated_from_file(self):
     assert Recipe.builder().ingredients({
         'expose': False
     }).build().expose() is False
Beispiel #8
0
 def test_autoscale_should_be_disabled_by_default(self):
     recipe = Recipe.builder().build()
     assert recipe.autoscale()['enabled'] is False
Beispiel #9
0
 def test_admin_privileges_should_be_disabled_by_default(self):
     recipe = Recipe.builder().build()
     assert recipe.admin_privileges()['enabled'] is False
Beispiel #10
0
 def test_expose_should_be_true(self):
     assert Recipe.builder().ingredients({}).build().expose() is True
Beispiel #11
0
 def test_empty_ports_list_as_default(self):
     assert Recipe.builder().build().ports() == []
Beispiel #12
0
 def test_service_type_should_be_api_by_default(self):
     recipe = Recipe.builder().ingredients({}).build()
     assert recipe.service_type() is Recipe.SERVICE_TYPE_API
Beispiel #13
0
 def test_service_type_should_be_delegated_from_ingredients(self):
     recipe = Recipe.builder().ingredients({
         'service_type':
         Recipe.SERVICE_TYPE_UI
     }).build()
     assert recipe.service_type() is Recipe.SERVICE_TYPE_UI
Beispiel #14
0
 def test_props_should_delegated_builder(self):
     recipe = Recipe.builder().ingredients({
         'expose': False
     }).image('popov').build()
     assert recipe.image() == 'popov'
     assert recipe.expose() is False
Beispiel #15
0
 def test_image_should_be_delegated_from_ingredients(self):
     assert Recipe.builder().ingredients({
         'image_name': 'kuku'
     }).build().image() == 'kuku'
Beispiel #16
0
 def test_raise_value_error_when_non_bool_value(self):
     Recipe.builder().ingredients({'expose': 11}).build().expose()