Example #1
0
    def test_port_validation(self):
        """
        Tests that validation fails for only a port_id
        """

        info = validate_stream(None, None, 2)
        self.assertEqual(info['error'], "Not enough info to uniquely identify a data stream. You must give either a datastream_id or both a node_id and a port_id. Example: \"datastream_id=1\" or \"node_id=1&port_id=3.\"\n\n")

        info = validate_stream(None, '', 2)
        self.assertEqual(info['error'], "Not enough info to uniquely identify a data stream. You must give either a datastream_id or both a node_id and a port_id. Example: \"datastream_id=1\" or \"node_id=1&port_id=3.\"\n\n")
Example #2
0
    def test_stream_node_port_validation(self):
        """
        Tests that validation works for node/port combo's
        """

        info = validate_stream(None, 1, 2)
        self.assertEqual(info['datastream'], self.stream)
Example #3
0
    def test_stream_id_validation(self):
        """
        Tests that validation works for stream id
        """

        info = validate_stream(4, None, None)
        self.assertEqual(info['datastream'], self.stream)