示例#1
0
 def test_overlapping_blocks_3(self):
     ret = TM35Block.overlapping_blocks(311145,
                                        6764630,
                                        327533,
                                        6766638,
                                        level=6)
     self.assertEqual(len(ret), 4)
     codes = [a.string for a in ret]
     self.assertTrue('M4111A' in codes)
     self.assertTrue('M4111C' in codes)
     self.assertTrue('M4111E' in codes)
     self.assertTrue('M4111G' in codes)
示例#2
0
 def test_overlapping_blocks_2(self):
     ret = TM35Block.overlapping_blocks(311145, 6764630, 327533, 6766638)
     self.assertEqual(len(ret), 12)
     codes = [a.string for a in ret]
     self.assertTrue('M4111A3' in codes)
     self.assertTrue('M4111A4' in codes)
     self.assertTrue('M4111C1' in codes)
     self.assertTrue('M4111C2' in codes)
     self.assertTrue('M4111C3' in codes)
     self.assertTrue('M4111C4' in codes)
     self.assertTrue('M4111E1' in codes)
     self.assertTrue('M4111E2' in codes)
     self.assertTrue('M4111E3' in codes)
     self.assertTrue('M4111E4' in codes)
     self.assertTrue('M4111G1' in codes)
     self.assertTrue('M4111G2' in codes)
示例#3
0
 def test_no_overlapping_blocks(self):
     ret = TM35Block.overlapping_blocks(0, 0, 1, 1)
     self.assertEqual(len(ret), 0)
示例#4
0
 def test_inequality_1(self):
     r1 = TM35Block.overlapping_blocks(300001, 6990001, 301000, 6991000)
     r2 = TM35Block.overlapping_blocks(303001, 6990001, 304000, 6991000)
     self.assertEqual(len(r1), 1)
     self.assertEqual(len(r2), 1)
     self.assertNotEqual(r1[0], r2[0])
示例#5
0
 def test_overlapping_blocks_1(self):
     ret = TM35Block.overlapping_blocks(308657, 6762534, 308658, 6762535)
     self.assertEqual(len(ret), 1)
     self.assertEqual(ret[0].string, 'M4111A1')