Exemplo n.º 1
0
def test_print_report():
    assert print_report({}) is None

    with open("tests/mocks/ami.json") as mock_file:
        json_to_parse = json.load(mock_file)
        ami = AMI.object_with_json(json_to_parse)
        candidates = {'test': [ami]}
        assert print_report(candidates) is None
Exemplo n.º 2
0
def test_print_report():
    assert Printer.print_report({}) is None

    with open("tests/mocks/ami.json") as mock_file:
        json_to_parse = json.load(mock_file)
        ami = AMI.object_with_json(json_to_parse)
        candidates = [ami]
        assert Printer.print_report(candidates) is None
Exemplo n.º 3
0
def test_remove_ami():
    cleaner = AMICleaner()

    with open("tests/mocks/ami.json") as mock_file:
        json_to_parse = json.load(mock_file)
        ami = AMI.object_with_json(json_to_parse)

        assert cleaner.remove_amis(None) is True
Exemplo n.º 4
0
def test_get_ami_from_json():
    with open("tests/mocks/ami.json") as mock_file:
        json_to_parse = json.load(mock_file)
        ami = AMI.object_with_json(json_to_parse)
        assert ami.id == "ami-02197662"
        assert ami.virtualization_type == "hvm"
        assert ami.name == "custom-debian-201511040131"
        assert repr(ami) == "AMI: ami-02197662 2015-11-04T01:35:31.000Z"
        assert ami.tags[0].value is not None
        assert ami.tags[0].value is not None
        assert len(ami.tags) == 2
        assert len(ami.block_device_mappings) == 2
Exemplo n.º 5
0
def test_get_ami_from_json():
    with open("tests/mocks/ami.json") as mock_file:
        json_to_parse = json.load(mock_file)
        ami = AMI.object_with_json(json_to_parse)
        assert ami.id == "ami-02197662"
        assert ami.virtualization_type == "hvm"
        assert ami.name == "custom-debian-201511040131"
        assert repr(ami) == "AMI: ami-02197662 2015-11-04T01:35:31.000Z"
        assert ami.tags[0].value is not None
        assert ami.tags[0].value is not None
        assert len(ami.tags) == 2
        assert len(ami.block_device_mappings) == 2
Exemplo n.º 6
0
def test_get_ami_from_none():
    ami = AMI.object_with_json(None)
    assert ami is None
Exemplo n.º 7
0
def test_get_ami_from_none():
    ami = AMI.object_with_json(None)
    assert ami is None