Beispiel #1
0
    def test_equal(self):
        """Check that the valid examples all result in the same output."""
        result_big = qr2scad.qr2scad(open(EXAMPLE_BIG))

        result_bw = qr2scad.qr2scad(open(EXAMPLE_BW))

        result_rgb = qr2scad.qr2scad(open(EXAMPLE_RGB))

        self.assertNotEqual(
            result_big,
            '')
        self.assertNotEqual(
            result_big,
            'module qrcode() {\n}\nqrcode();')
        self.assertNotEqual(
            result_bw,
            '')
        self.assertNotEqual(
            result_rgb,
            '')
        self.assertEqual(
            result_bw,
            result_rgb)
        self.assertEqual(
            result_big,
            result_bw)
Beispiel #2
0
    def test_equal(self):
        """Check that the valid examples all result in the same output."""
        result_big = qr2scad.qr2scad(open(EXAMPLE_BIG))

        result_bw = qr2scad.qr2scad(open(EXAMPLE_BW))

        result_rgb = qr2scad.qr2scad(open(EXAMPLE_RGB))

        self.assertNotEqual(result_big, '')
        self.assertNotEqual(result_big, 'module qrcode() {\n}\nqrcode();')
        self.assertNotEqual(result_bw, '')
        self.assertNotEqual(result_rgb, '')
        self.assertEqual(result_bw, result_rgb)
        self.assertEqual(result_big, result_bw)
Beispiel #3
0
 def test_big(self):
     """Check that a big image gives output."""
     result = qr2scad.qr2scad(open(EXAMPLE_BIG))
     self.assertNotEqual(
         result,
         '')
     self.assertNotEqual(
         result,
         'module qrcode() {\n}\nqrcode();')
Beispiel #4
0
 def test_black_and_white(self):
     """Check that a black-and-white image gives output."""
     result = qr2scad.qr2scad(open(EXAMPLE_BW))
     self.assertNotEqual(
         result,
         None)
     self.assertNotEqual(
         result,
         '')
     self.assertNotEqual(
         result,
         'module qrcode() {\n}\nqrcode();')
Beispiel #5
0
 def test_big(self):
     """Check that a big image gives output."""
     result = qr2scad.qr2scad(open(EXAMPLE_BIG))
     self.assertNotEqual(result, '')
     self.assertNotEqual(result, 'module qrcode() {\n}\nqrcode();')
Beispiel #6
0
 def test_black_and_white(self):
     """Check that a black-and-white image gives output."""
     result = qr2scad.qr2scad(open(EXAMPLE_BW))
     self.assertNotEqual(result, None)
     self.assertNotEqual(result, '')
     self.assertNotEqual(result, 'module qrcode() {\n}\nqrcode();')