Ejemplo n.º 1
0
def test_should_shorten_director_name_if_director_and_more_relevant_parts_are_longer_than_maximum_length(
):
    backend = create_backend(12, 'awesomeService_alpha',
                             'dc_longname_111111111111111111111111111111',
                             '127.0.20.30', 8080)
    expectedBackendName = "awesome_12_dc_longname_111111111111111111111111111111_20_30_8080"
    assert_equals(expectedBackendName, make_backend_name(backend))
Ejemplo n.º 2
0
def test_should_cut_director_if_more_relevant_parts_are_longer_than_maximum_length(
):
    backend = create_backend(
        11, 'beta_awesomeService',
        'dc_longname_11111111111111111111111111111111111111', '127.0.20.30',
        8080)
    expectedBackendName = "11_dc_longname_11111111111111111111111111111111111111_20_30_8080"
    assert_equals(expectedBackendName, make_backend_name(backend))
Ejemplo n.º 3
0
def test_should_make_backend_name_which_contain_all_relevant_parts():
    backend = create_backend(10, 'awesomeService', 'dc666', '127.0.20.30', 8080)
    expectedBackendName = "awesomeService_10_dc666_20_30_8080"
    assert_equals(expectedBackendName, make_backend_name(backend))
Ejemplo n.º 4
0
 def __unicode__(self):
     return make_backend_name(self)
Ejemplo n.º 5
0
 def __unicode__(self):
     return make_backend_name(self)
Ejemplo n.º 6
0
 def __str__(self):
     return make_backend_name(self)
Ejemplo n.º 7
0
def test_should_shorten_director_name_if_director_and_more_relevant_parts_are_longer_than_maximum_length():
    backend = create_backend(
        12, 'awesomeService_alpha', 'dc_longname_111111111111111111111111111111', '127.0.20.30', 8080
    )
    expectedBackendName = "awesome_12_dc_longname_111111111111111111111111111111_20_30_8080"
    assert_equals(expectedBackendName, make_backend_name(backend))
Ejemplo n.º 8
0
def test_should_cut_director_if_more_relevant_parts_are_longer_than_maximum_length():
    backend = create_backend(
        11, 'beta_awesomeService', 'dc_longname_11111111111111111111111111111111111111', '127.0.20.30', 8080
    )
    expectedBackendName = "11_dc_longname_11111111111111111111111111111111111111_20_30_8080"
    assert_equals(expectedBackendName, make_backend_name(backend))
Ejemplo n.º 9
0
def test_should_make_backend_name_which_contain_all_relevant_parts():
    backend = create_backend(10, 'awesomeService', 'dc666', '127.0.20.30', 8080)
    expectedBackendName = "awesomeService_10_dc666_20_30_8080"
    assert_equals(expectedBackendName, make_backend_name(backend))