Example #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
Example #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
Example #3
0
 def test_ports_should_delegate_from_ingredients(self):
     recipe = Recipe.builder().ingredients({
         'ports': [{
             'name': 'kuku'
         }]
     }).build()
     assert recipe.ports()[0]['name'] == 'kuku'
Example #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'
Example #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'
Example #6
0
 def test_ingress_should_be_disabled_by_default(self):
     recipe = Recipe.builder().build()
     assert recipe.ingress()['enabled'] is False
Example #7
0
 def test_expose_should_be_delegated_from_file(self):
     assert Recipe.builder().ingredients({
         'expose': False
     }).build().expose() is False
Example #8
0
 def test_autoscale_should_be_disabled_by_default(self):
     recipe = Recipe.builder().build()
     assert recipe.autoscale()['enabled'] is False
Example #9
0
 def test_admin_privileges_should_be_disabled_by_default(self):
     recipe = Recipe.builder().build()
     assert recipe.admin_privileges()['enabled'] is False
Example #10
0
 def test_expose_should_be_true(self):
     assert Recipe.builder().ingredients({}).build().expose() is True
Example #11
0
 def test_empty_ports_list_as_default(self):
     assert Recipe.builder().build().ports() == []
Example #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
Example #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
Example #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
Example #15
0
 def test_image_should_be_delegated_from_ingredients(self):
     assert Recipe.builder().ingredients({
         'image_name': 'kuku'
     }).build().image() == 'kuku'
Example #16
0
 def test_raise_value_error_when_non_bool_value(self):
     Recipe.builder().ingredients({'expose': 11}).build().expose()