Exemplo n.º 1
0
 def _create_records(self, default_route_domain, records):
     """Create a list of records for the tunnel."""
     new_records = list()
     for record in records:
         record['default_route_domain'] = default_route_domain
         new_records.append(Record(**record).data)
     return new_records
Exemplo n.º 2
0
def test_eq():
    """Test Record equality."""
    record1 = Record(**cfg_test)
    record2 = Record(**cfg_test)
    assert record1 == record2

    # name not equal
    cfg_changed = copy(cfg_test)
    cfg_changed['name'] = '98:ab:76:cd:54:ef'
    record2 = Record(**cfg_changed)
    assert record1 != record2

    # endpoint not equal
    cfg_changed = copy(cfg_test)
    cfg_changed['endpoint'] = '4.3.2.1'
    record2 = Record(**cfg_changed)
    assert record1 != record2
Exemplo n.º 3
0
def test_uri_path(bigip):
    """Test Record URI."""
    record = Record(**cfg_test)

    with pytest.raises(NotImplementedError):
        record._uri_path(bigip)
Exemplo n.º 4
0
def test_create_record():
    """Test Record creation."""
    record = Record(**cfg_test)
    assert Record
    assert record.name == '12:ab:34:cd:56:ef'
    assert record.data['endpoint'] == '1.2.3.4' 
Exemplo n.º 5
0
def test_uri_path(bigip):
    """Test Record URI."""
    record = Record(**cfg_test)

    with pytest.raises(NotImplementedError):
        record._uri_path(bigip)
Exemplo n.º 6
0
 def _create_records(self, records):
     """Create a list of records for the tunnel."""
     new_records = list()
     for record in records:
         new_records.append(Record(**record).data)
     return new_records