Exemplo n.º 1
0
 def test_not_prod(self):
     """All non-prod habitats have the same workflow, so just test one."""
     expected = "stagexservices1"
     collated_service_yamls = {
         "stagex": {
             expected: 5,
             "stagexservices2": 10,
             "stagex-ineligibile-non-services-box3": 1,
         },
     }
     actual = autosuggest.suggest_hosts_for_habitat(collated_service_yamls, "stagex")
     assert expected == actual
Exemplo n.º 2
0
 def test_prod(self):
     expected = "host1,host2"
     collated_service_yamls = {
         "hab1": {
             "host1": 99,
             "host2": 99,
             "host3": 1,
             "host4": 1,
         },
         # All these machines will be filtered out since they're not general service machines.
         "hab2": {
             "host5": 10,
             "host6": 1,
             "host7": 1,
         },
     }
     actual = autosuggest.suggest_hosts_for_habitat(collated_service_yamls, "hab1")
     assert expected == actual
Exemplo n.º 3
0
 def test_habitat_not_in_collated_service_yamls(self):
     collated_service_yamls = {}
     actual = autosuggest.suggest_hosts_for_habitat(collated_service_yamls, "nonexistent")
     assert "" == actual