Loading autocnet/graph/tests/test_edge.py +17 −0 Original line number Diff line number Diff line import unittest from unittest.mock import patch from unittest.mock import Mock from unittest.mock import PropertyMock from osgeo import ogr import pandas as pd Loading Loading @@ -44,3 +48,16 @@ class TestEdge(unittest.TestCase): def test_compute_fundamental_matrix(self): with self.assertRaises(AttributeError): self.edge.compute_fundamental_matrix() def test_overlap(self): wkt1 = "POLYGON ((0 40, 40 40, 40 0, 0 0, 0 40))" wkt2 = "POLYGON ((20 60, 60 60, 60 20, 20 20, 20 60))" poly1 = ogr.CreateGeometryFromWkt(wkt1) poly2 = ogr.CreateGeometryFromWkt(wkt2) with patch.object(self.edge.source.geodata, 'footprint' ,new_callable=PropertyMock) as patch_fp: patch_fp.return_value = poly1 with patch.object(self.edge.destination.geodata, 'footprint' ,new_callable=PropertyMock) as patch_fp: patch_fp.return_value = poly2 No newline at end of file Loading
autocnet/graph/tests/test_edge.py +17 −0 Original line number Diff line number Diff line import unittest from unittest.mock import patch from unittest.mock import Mock from unittest.mock import PropertyMock from osgeo import ogr import pandas as pd Loading Loading @@ -44,3 +48,16 @@ class TestEdge(unittest.TestCase): def test_compute_fundamental_matrix(self): with self.assertRaises(AttributeError): self.edge.compute_fundamental_matrix() def test_overlap(self): wkt1 = "POLYGON ((0 40, 40 40, 40 0, 0 0, 0 40))" wkt2 = "POLYGON ((20 60, 60 60, 60 20, 20 20, 20 60))" poly1 = ogr.CreateGeometryFromWkt(wkt1) poly2 = ogr.CreateGeometryFromWkt(wkt2) with patch.object(self.edge.source.geodata, 'footprint' ,new_callable=PropertyMock) as patch_fp: patch_fp.return_value = poly1 with patch.object(self.edge.destination.geodata, 'footprint' ,new_callable=PropertyMock) as patch_fp: patch_fp.return_value = poly2 No newline at end of file