Example #1
0
    def test_logbook_add_flow_detail(self):
        # Get the logbook from the backend
        actual = b_api.logbook_get(self.lb_ids[0])

        # Check that it has no flowdetails
        self.assertEquals(len(actual), 0)

        # Add a flowdetail to the logbook
        b_api.logbook_add_flow_detail(self.lb_ids[0], self.fd_ids[0])

        # Get the logbook again
        actual = b_api.logbook_get(self.lb_ids[0])

        # Check that the logbook has exactly one flowdetail
        self.assertEquals(len(actual), 1)
Example #2
0
    def test_logbook_remove_flowdetail(self):
        # Add a flowdetail to the first logbook
        b_api.logbook_add_flow_detail(self.lb_ids[0], self.fd_ids[0])

        # Get the first logbook
        actual = b_api.logbook_get(self.lb_ids[0])

        # Check that it has exactly one flowdetail
        self.assertEquals(len(actual), 1)

        # Remove the flowdetail from the logbook
        b_api.logbook_remove_flowdetail(self.lb_ids[0], self.fd_ids[0])

        # Get the logbook again
        actual = b_api.logbook_get(self.lb_ids[0])

        # Check that the logbook now has no flowdetails
        self.assertEquals(len(actual), 0)