Ejemplo n.º 1
0
 def test_with_file_missing(self, mock_get_settings_failed):
     with pytest.raises(Exception):
         readers.find_tail_host(host=self.TEST_HOST)
Ejemplo n.º 2
0
    def test_with_host_key_missing(self, mock_get_settings):
        OTHER_TEST_HOST = 'fake-host-2'
        tail_host = readers.find_tail_host(host=OTHER_TEST_HOST)

        assert tail_host == OTHER_TEST_HOST
Ejemplo n.º 3
0
def test_find_tail_host_devb(mock_ecosystem, mock_settings):
    mock_ecosystem.return_value = 'eco1'
    mock_settings.side_effect = get_settings_side_effect
    assert readers.find_tail_host() == readers.find_tail_host('scribe.local.yelpcorp.com') == 'tail-host2.dev.yelpcorp.com'
Ejemplo n.º 4
0
    def test(self, mock_get_settings):
        tail_host = readers.find_tail_host(host=self.TEST_HOST)

        assert tail_host == self.TEST_TAIL_HOST
Ejemplo n.º 5
0
def test_find_tail_host_prod(mock_region, mock_ecosystem, mock_settings):
    mock_ecosystem.return_value = 'prod'
    mock_region.return_value = 'region1'
    mock_settings.side_effect = get_settings_side_effect
    assert readers.find_tail_host() == readers.find_tail_host('scribe.local.yelpcorp.com') == 'tail-host1.prod.yelpcorp.com'
Ejemplo n.º 6
0
def test_find_tail_host():
    assert readers.find_tail_host('fakehost') == 'fakehost'
Ejemplo n.º 7
0
def test_find_tail_host():
    assert readers.find_tail_host('fakehost') == 'fakehost'
Ejemplo n.º 8
0
def test_find_tail_host_devb(mock_ecosystem, mock_settings):
    mock_ecosystem.return_value = 'eco1'
    mock_settings.side_effect = get_settings_side_effect
    assert readers.find_tail_host() == readers.find_tail_host(
        'scribe.local.yelpcorp.com') == 'tail-host2.dev.yelpcorp.com'
Ejemplo n.º 9
0
def test_find_tail_host_prod(mock_region, mock_ecosystem, mock_settings):
    mock_ecosystem.return_value = 'prod'
    mock_region.return_value = 'region1'
    mock_settings.side_effect = get_settings_side_effect
    assert readers.find_tail_host() == readers.find_tail_host(
        'scribe.local.yelpcorp.com') == 'tail-host1.prod.yelpcorp.com'