Exemple #1
0
def main():
    inventory_set = set(inventory())
    inventory_connected_set = set(inventory_connected())
    inventory_not_connected_set = set(inventory_not_connected())
    inventory_mounted_set = set(inventory_mounted())
    inventory_unmounted_set = set(inventory_unmounted())
    empty_set = set()

    print("The set of 'connected' devices is a subset of the inventory:",
          inventory_connected_set <= inventory_set)
    assert inventory_connected_set <= inventory_set

    print(
        "The set of 'not connected' devices is also a subset of the inventory:",
        inventory_not_connected_set <= inventory_set)
    assert inventory_not_connected_set <= inventory_set

    print(
        "There are no network devices in both the 'connected' set and the 'not connected' set:",
        inventory_not_connected_set & inventory_connected_set == empty_set)
    assert inventory_not_connected_set & inventory_connected_set == empty_set

    print(
        "Every network device in the inventory is in either the 'connected' set or the 'not connected' set:",
        inventory_connected_set | inventory_not_connected_set == inventory_set)
    assert inventory_connected_set | inventory_not_connected_set == inventory_set

    print()

    print("The set of 'mounted' devices is a subset of the inventory:",
          inventory_mounted_set <= inventory_set)
    assert inventory_mounted_set <= inventory_set

    print(
        "The set of 'unmounted' devices has no intersection with the inventory:",
        inventory_unmounted_set & inventory_set == empty_set)
    assert inventory_unmounted_set & inventory_set == empty_set, 'Expect no intersection, got %s' % (
        inventory_unmounted_set & inventory_set)

    print(
        "There are no network devices in both the 'mounted' set and the 'unmounted' set:",
        inventory_unmounted_set & inventory_mounted_set == empty_set)
    assert inventory_unmounted_set & inventory_mounted_set == empty_set
def main():
    inventory_set = set(inventory())
    inventory_connected_set = set(inventory_connected())
    inventory_not_connected_set = set(inventory_not_connected())
    inventory_mounted_set = set(inventory_mounted())
    inventory_unmounted_set = set(inventory_unmounted())
    empty_set = set()
    
    print("The set of 'connected' devices is a subset of the inventory:",
           inventory_connected_set <= inventory_set)
    assert inventory_connected_set <= inventory_set
    
    print("The set of 'not connected' devices is also a subset of the inventory:",
           inventory_not_connected_set <= inventory_set)
    assert inventory_not_connected_set <= inventory_set
    
    print("There are no network devices in both the 'connected' set and the 'not connected' set:",
           inventory_not_connected_set & inventory_connected_set == empty_set)
    assert inventory_not_connected_set & inventory_connected_set == empty_set
    
    print("Every network device in the inventory is in either the 'connected' set or the 'not connected' set:",
           inventory_connected_set | inventory_not_connected_set == inventory_set)
    assert inventory_connected_set | inventory_not_connected_set == inventory_set
    
    print()
    
    print("The set of 'mounted' devices is a subset of the inventory:",
           inventory_mounted_set <= inventory_set)
    assert inventory_mounted_set <= inventory_set
    
    print("The set of 'unmounted' devices has no intersection with the inventory:",
           inventory_unmounted_set & inventory_set == empty_set)
    assert inventory_unmounted_set & inventory_set == empty_set, 'Expect no intersection, got %s' % (inventory_unmounted_set & inventory_set)
    
    print("There are no network devices in both the 'mounted' set and the 'unmounted' set:",
           inventory_unmounted_set & inventory_mounted_set == empty_set)
    assert inventory_unmounted_set & inventory_mounted_set == empty_set
def main():
    print(plain(doc(inventory_not_connected)))
    print("inventory_not_connected()")
    print_table(inventory_not_connected())
Exemple #4
0
def main():
    print(plain(doc(inventory_not_connected)))
    print(inventory_not_connected())
def main():
    print(plain(doc(inventory_not_connected)))
    print("inventory_not_connected()")
    print_table(inventory_not_connected(), headers='device-name')
def main():
    print(plain(doc(inventory_not_connected)))
    print("inventory_not_connected()")
    print_table(inventory_not_connected(), headers="device-name")