Exemplo n.º 1
0
 def test05_parse_rotation(self):
     r = IIIFRequest()
     r.parse_rotation('0')
     self.assertEqual(r.rotation_mirror, False)
     self.assertEqual(r.rotation_deg, 0.0)
     r.parse_rotation('0.0000')
     self.assertEqual(r.rotation_mirror, False)
     self.assertEqual(r.rotation_deg, 0.0)
     r.parse_rotation('0.000001')
     self.assertEqual(r.rotation_mirror, False)
     self.assertEqual(r.rotation_deg, 0.000001)
     r.parse_rotation('180')
     self.assertEqual(r.rotation_mirror, False)
     self.assertEqual(r.rotation_deg, 180.0)
     r.parse_rotation('360')
     self.assertEqual(r.rotation_mirror, False)
     self.assertEqual(r.rotation_deg, 0.0)
     r.parse_rotation('!0')
     self.assertEqual(r.rotation_mirror, True)
     self.assertEqual(r.rotation_deg, 0.0)
     r.parse_rotation('!0.000')
     self.assertEqual(r.rotation_mirror, True)
     self.assertEqual(r.rotation_deg, 0.0)
     r.parse_rotation('!123.45678')
     self.assertEqual(r.rotation_mirror, True)
     self.assertEqual(r.rotation_deg, 123.45678)
Exemplo n.º 2
0
 def test05_parse_rotation(self):
     """Rotation."""
     r = IIIFRequest(api_version='2.0')
     r.parse_rotation('0')
     self.assertEqual(r.rotation_mirror, False)
     self.assertEqual(r.rotation_deg, 0.0)
     r.parse_rotation('0.0000')
     self.assertEqual(r.rotation_mirror, False)
     self.assertEqual(r.rotation_deg, 0.0)
     r.parse_rotation('0.000001')
     self.assertEqual(r.rotation_mirror, False)
     self.assertEqual(r.rotation_deg, 0.000001)
     r.parse_rotation('180')
     self.assertEqual(r.rotation_mirror, False)
     self.assertEqual(r.rotation_deg, 180.0)
     r.parse_rotation('360')
     self.assertEqual(r.rotation_mirror, False)
     self.assertEqual(r.rotation_deg, 0.0)
     r.parse_rotation('!0')
     self.assertEqual(r.rotation_mirror, True)
     self.assertEqual(r.rotation_deg, 0.0)
     r.parse_rotation('!0.000')
     self.assertEqual(r.rotation_mirror, True)
     self.assertEqual(r.rotation_deg, 0.0)
     r.parse_rotation('!123.45678')
     self.assertEqual(r.rotation_mirror, True)
     self.assertEqual(r.rotation_deg, 123.45678)
Exemplo n.º 3
0
 def test05_parse_rotation(self):
     """Rotation."""
     r = IIIFRequest(api_version="1.0")
     r.parse_rotation("0")
     self.assertEqual(r.rotation_mirror, False)
     self.assertEqual(r.rotation_deg, 0.0)
     r.parse_rotation("0.0000")
     self.assertEqual(r.rotation_mirror, False)
     self.assertEqual(r.rotation_deg, 0.0)
     r.parse_rotation("0.000001")
     self.assertEqual(r.rotation_mirror, False)
     self.assertEqual(r.rotation_deg, 0.000001)
     r.parse_rotation("180")
     self.assertEqual(r.rotation_mirror, False)
     self.assertEqual(r.rotation_deg, 180.0)
     r.parse_rotation("360")
     self.assertEqual(r.rotation_mirror, False)
     self.assertEqual(r.rotation_deg, 0.0)
     r.parse_rotation("!0")
     self.assertEqual(r.rotation_mirror, True)
     self.assertEqual(r.rotation_deg, 0.0)
     r.parse_rotation("!0.000")
     self.assertEqual(r.rotation_mirror, True)
     self.assertEqual(r.rotation_deg, 0.0)
     r.parse_rotation("!123.45678")
     self.assertEqual(r.rotation_mirror, True)
     self.assertEqual(r.rotation_deg, 123.45678)
Exemplo n.º 4
0
 def test05_parse_rotation(self):
     """Parse rotation."""
     r = IIIFRequest(api_version='2.1')
     r.parse_rotation('0')
     self.assertEqual(r.rotation_mirror, False)
     self.assertEqual(r.rotation_deg, 0.0)
     r.parse_rotation('0.0000')
     self.assertEqual(r.rotation_mirror, False)
     self.assertEqual(r.rotation_deg, 0.0)
     r.parse_rotation('0.000001')
     self.assertEqual(r.rotation_mirror, False)
     self.assertEqual(r.rotation_deg, 0.000001)
     r.parse_rotation('180')
     self.assertEqual(r.rotation_mirror, False)
     self.assertEqual(r.rotation_deg, 180.0)
     r.parse_rotation('360')
     self.assertEqual(r.rotation_mirror, False)
     self.assertEqual(r.rotation_deg, 0.0)
     r.parse_rotation('!0')
     self.assertEqual(r.rotation_mirror, True)
     self.assertEqual(r.rotation_deg, 0.0)
     r.parse_rotation('!0.000')
     self.assertEqual(r.rotation_mirror, True)
     self.assertEqual(r.rotation_deg, 0.0)
     r.parse_rotation('!123.45678')
     self.assertEqual(r.rotation_mirror, True)
     self.assertEqual(r.rotation_deg, 123.45678)
     # nothing supplied
     r.rotation = None
     r.parse_rotation()
     self.assertEqual(r.rotation_mirror, False)
     self.assertEqual(r.rotation_deg, 0.0)
Exemplo n.º 5
0
 def test05_parse_rotation(self):
     """Parse rotation."""
     r = IIIFRequest(api_version='3.0')
     r.parse_rotation('0')
     self.assertEqual(r.rotation_mirror, False)
     self.assertEqual(r.rotation_deg, 0.0)
     r.parse_rotation('0.0000')
     self.assertEqual(r.rotation_mirror, False)
     self.assertEqual(r.rotation_deg, 0.0)
     r.parse_rotation('0.000001')
     self.assertEqual(r.rotation_mirror, False)
     self.assertEqual(r.rotation_deg, 0.000001)
     r.parse_rotation('180')
     self.assertEqual(r.rotation_mirror, False)
     self.assertEqual(r.rotation_deg, 180.0)
     r.parse_rotation('360')
     self.assertEqual(r.rotation_mirror, False)
     self.assertEqual(r.rotation_deg, 0.0)
     r.parse_rotation('!0')
     self.assertEqual(r.rotation_mirror, True)
     self.assertEqual(r.rotation_deg, 0.0)
     r.parse_rotation('!0.000')
     self.assertEqual(r.rotation_mirror, True)
     self.assertEqual(r.rotation_deg, 0.0)
     r.parse_rotation('!123.45678')
     self.assertEqual(r.rotation_mirror, True)
     self.assertEqual(r.rotation_deg, 123.45678)
     # nothing supplied
     r.rotation = None
     r.parse_rotation()
     self.assertEqual(r.rotation_mirror, False)
     self.assertEqual(r.rotation_deg, 0.0)