示例#1
0
def test_validate_given_instances_duplicate_args():
    service_instances = ['instance1', 'instance2', 'instance3']
    given_instances = ['instance1', 'instance1']

    expected_valid = set(['instance1'])
    expected_invalid = set([])

    actual_valid, actual_invalid = validate_given_instances(service_instances, given_instances)

    assert actual_valid == expected_valid
    assert actual_invalid == expected_invalid
示例#2
0
def test_validate_given_instances_wrong_arg():
    service_instances = ['instance1', 'instance2']
    given_instances = ['instance0', 'not_an_instance']

    expected_valid = set([])
    expected_invalid = set(['instance0', 'not_an_instance'])

    actual_valid, actual_invalid = validate_given_instances(service_instances, given_instances)

    assert actual_valid == expected_valid
    assert actual_invalid == expected_invalid
示例#3
0
def test_validate_given_instances_duplicate_args():
    service_instances = ['instance1', 'instance2', 'instance3']
    given_instances = ['instance1', 'instance1']

    expected_valid = set(['instance1'])
    expected_invalid = set([])

    actual_valid, actual_invalid = validate_given_instances(
        service_instances, given_instances)

    assert actual_valid == expected_valid
    assert actual_invalid == expected_invalid
示例#4
0
def test_validate_given_instances_wrong_arg():
    service_instances = ['instance1', 'instance2']
    given_instances = ['instance0', 'not_an_instance']

    expected_valid = set([])
    expected_invalid = set(['instance0', 'not_an_instance'])

    actual_valid, actual_invalid = validate_given_instances(
        service_instances, given_instances)

    assert actual_valid == expected_valid
    assert actual_invalid == expected_invalid