def test_matrix_view(self):
        """Does the page load with the data as expected.
        """
        client = self.client
        reply = check_code(client, '/v4/nts/matrix?plot.0=2.6.3')
        # Make sure the data is in the page.
        self.assertIn("test6", reply.data)
        self.assertIn("1.0000", reply.data)
        self.assertIn("1.2000", reply.data)

        reply = check_code(client, '/v4/nts/matrix?plot.0=2.6.3&limit=1')
Exemple #2
0
    def test_matrix_view(self):
        """Does the page load with the data as expected.
        """
        client = self.client
        reply = check_html(client, '/v4/nts/matrix?plot.0=2.6.2')
        # Set a baseline and run again.
        form_data = dict(name="foo_baseline",
                         description="foo_description",
                         prmote=True)
        rc = client.post('/v4/nts/order/6', data=form_data)
        self.assertEquals(rc.status_code, HTTP_REDIRECT)
        check_code(client, '/v4/nts/set_baseline/1',
                   expected_code=HTTP_REDIRECT)

        reply = check_html(client, '/v4/nts/matrix?plot.0=2.6.2')
        # Make sure the data is in the page.
        self.assertIn("test6", reply.data)
        self.assertIn("1.0000", reply.data)
        self.assertIn("1.2000", reply.data)

        reply = check_html(client, '/v4/nts/matrix?plot.0=2.6.2&limit=1')
    def test_matrix_view(self):
        """Does the page load with the data as expected.
        """
        client = self.client
        reply = check_code(client, '/v4/nts/matrix?plot.0=2.6.3')
        # Set a baseline and run again.
        form_data = dict(name="foo_baseline",
                         description="foo_description",
                         prmote=True)
        rc = client.post('/v4/nts/order/6', data=form_data)
        self.assertEquals(rc.status_code, HTTP_REDIRECT)
        check_code(client, '/v4/nts/set_baseline/1',
                   expected_code=HTTP_REDIRECT)

        reply = check_code(client, '/v4/nts/matrix?plot.0=2.6.3')
        # Make sure the data is in the page.
        self.assertIn("test6", reply.data)
        self.assertIn("1.0000", reply.data)
        self.assertIn("1.2000", reply.data)

        reply = check_code(client, '/v4/nts/matrix?plot.0=2.6.3&limit=1')
Exemple #4
0
    def test_config_errors(self):
        """Does passing bad arguments to matrix view error correctly.
        """
        client = self.client
        reply = check_code(client,
                           '/v4/nts/matrix',
                           expected_code=HTTP_NOT_FOUND)
        self.assertIn("Request requires some data arguments.",
                      reply.get_data(as_text=True))

        reply = check_code(client,
                           '/v4/nts/matrix?plot.0=1.1.1',
                           expected_code=HTTP_NOT_FOUND)
        self.assertIn("No data found.", reply.get_data(as_text=True))

        reply = check_code(client,
                           '/v4/nts/matrix?plot.0=a.2.0',
                           expected_code=HTTP_BAD_REQUEST)
        self.assertIn("malformed", reply.get_data(as_text=True))

        reply = check_code(client,
                           '/v4/nts/matrix?plot.0=999.0.0',
                           expected_code=HTTP_NOT_FOUND)
        self.assertIn("Invalid machine", reply.get_data(as_text=True))
        reply = check_code(client,
                           '/v4/nts/matrix?plot.0=1.999.0',
                           expected_code=HTTP_NOT_FOUND)
        self.assertIn("Invalid test", reply.get_data(as_text=True))
        reply = check_code(client,
                           '/v4/nts/matrix?plot.0=1.1.999',
                           expected_code=HTTP_NOT_FOUND)
        self.assertIn("Invalid field", reply.get_data(as_text=True))
Exemple #5
0
    def test_config_errors(self):
        """Does passing bad arguments to matrix view error correctly.
        """
        client = self.client
        reply = check_code(client, '/v4/nts/matrix',
                           expected_code=HTTP_NOT_FOUND)
        self.assertIn("Request requires some data arguments.", reply.data)

        reply = check_code(client, '/v4/nts/matrix?plot.0=1.1.1',
                           expected_code=HTTP_NOT_FOUND)
        self.assertIn("No data found.", reply.data)

        reply = check_code(client, '/v4/nts/matrix?plot.0=a.2.0',
                           expected_code=HTTP_BAD_REQUEST)
        self.assertIn("malformed", reply.data)

        reply = check_code(client, '/v4/nts/matrix?plot.0=999.0.0',
                           expected_code=HTTP_NOT_FOUND)
        self.assertIn("Invalid machine", reply.data)
        reply = check_code(client, '/v4/nts/matrix?plot.0=1.999.0',
                           expected_code=HTTP_NOT_FOUND)
        self.assertIn("Invalid test", reply.data)
        reply = check_code(client, '/v4/nts/matrix?plot.0=1.1.999',
                           expected_code=HTTP_NOT_FOUND)
        self.assertIn("Invalid field", reply.data)