Beispiel #1
0
 def test_real_world(self):
     s = textwrap.dedent('''\
              39.9317755024
              30.0907511581
              30.0907511576
             -39.9317755019
         2658137.2266720217
         5990821.7039887439''')  # no EOL
     a1 = affine.loadsw(s)
     assert a1.almost_equals(
         Affine(39.931775502364644, 30.090751157602412, 2658102.2154086917,
                30.090751157602412, -39.931775502364644, 5990826.624500916))
     a1out = affine.dumpsw(a1)
     assert isinstance(a1out, str)
     a2 = affine.loadsw(a1out)
     assert a1.almost_equals(a2)
Beispiel #2
0
 def test_real_world(self):
     s = textwrap.dedent('''\
              39.9317755024
              30.0907511581
              30.0907511576
             -39.9317755019
         2658137.2266720217
         5990821.7039887439''')  # no EOL
     a1 = affine.loadsw(s)
     assert a1.almost_equals(
         Affine(
             39.931775502364644, 30.090751157602412, 2658102.2154086917,
             30.090751157602412, -39.931775502364644, 5990826.624500916))
     a1out = affine.dumpsw(a1)
     assert isinstance(a1out, str)
     a2 = affine.loadsw(a1out)
     assert a1.almost_equals(a2)
Beispiel #3
0
 def test_simple_world(self):
     s = '1.0\n0.0\n0.0\n-1.0\n100.5\n199.5\n'
     a = affine.loadsw(s)
     assert \
         a == \
         Affine(
             1.0, 0.0, 100.0,
             0.0, -1., 200.0)
     assert affine.dumpsw(a) == s
Beispiel #4
0
 def test_real_world(self):
     from affine import loadsw, dumpsw
     s = dedent('''\
              39.9317755024
              30.0907511581
              30.0907511576
             -39.9317755019
         2658137.2266720217
         5990821.7039887439''')  # no EOL
     a1 = loadsw(s)
     self.assertTrue(a1.almost_equals(
         Affine(
             39.931775502364644, 30.090751157602412, 2658102.2154086917,
             30.090751157602412, -39.931775502364644, 5990826.624500916)))
     a1out = dumpsw(a1)
     self.assertTrue(isinstance(a1out, str))
     a2 = loadsw(a1out)
     self.assertTrue(a1.almost_equals(a2))
Beispiel #5
0
 def test_simple_world(self):
     s = '1.0\n0.0\n0.0\n-1.0\n100.5\n199.5\n'
     a = affine.loadsw(s)
     assert \
         a == \
         Affine(
             1.0, 0.0, 100.0,
             0.0, -1., 200.0)
     assert affine.dumpsw(a) == s
Beispiel #6
0
 def test_simple_world(self):
     from affine import loadsw, dumpsw
     s = '1.0\n0.0\n0.0\n-1.0\n100.5\n199.5\n'
     a = loadsw(s)
     self.assertEqual(
         a,
         Affine(
             1.0, 0.0, 100.0,
             0.0, -1., 200.0))
     self.assertEqual(dumpsw(a), s)
Beispiel #7
0
 def test_bad_value_world(self):
     """Wrong number of parameters."""
     with pytest.raises(ValueError):
         affine.loadsw('1.0\n0.0\n0.0\n1.0\n0.0\n0.0\n0.0')
Beispiel #8
0
 def test_bad_type_world(self):
     """wrong type, i.e don't use readlines()"""
     with pytest.raises(TypeError):
         affine.loadsw(['1.0', '0.0', '0.0', '1.0', '0.0', '0.0'])
Beispiel #9
0
 def test_bad_value_world(self):
     from affine import loadsw
     # wrong number of parameters
     loadsw('1.0\n0.0\n0.0\n1.0\n0.0\n0.0\n0.0')
Beispiel #10
0
 def test_bad_type_world(self):
     from affine import loadsw
     # wrong type, i.e don't use readlines()
     loadsw(['1.0', '0.0', '0.0', '1.0', '0.0', '0.0'])
Beispiel #11
0
 def test_bad_value_world(self):
     """Wrong number of parameters."""
     with pytest.raises(ValueError):
         affine.loadsw('1.0\n0.0\n0.0\n1.0\n0.0\n0.0\n0.0')
Beispiel #12
0
 def test_bad_type_world(self):
     """wrong type, i.e don't use readlines()"""
     with pytest.raises(TypeError):
         affine.loadsw(['1.0', '0.0', '0.0', '1.0', '0.0', '0.0'])