from unittest import TestCase
from app.texture_extractor import Reconstructor


class TestReconstructor(TestCase):
    
    def test_convertToVirtualPlane(self):
        reconstructor = Reconstructor((20, 10), 1, 1)
        self.assertTupleEqual(reconstructor.convertToVirtualPlane((0, 0)), (-10, 5))
        self.assertTupleEqual(reconstructor.convertToVirtualPlane((5, 10)), (0, 0))
        self.assertTupleEqual(reconstructor.convertToVirtualPlane((10, 20)), (10, -5))
        self.assertTupleEqual(reconstructor.convertToVirtualPlane((20, 10)), (0, -15))
        self.assertTupleEqual(reconstructor.convertToVirtualPlane((7.5, 5)), (-5, -2.5))

    def test_calculate3DCoordinate (self):
		reconstructor = Reconstructor ((10, 20), 10, 5)
		self.assertTupleEqual (reconstructor.calculate3DCoordinate ((5, 10), 10), (0, 0, 10))
		self.assertTupleEqual (reconstructor.calculate3DCoordinate ((0, 0), 10), (-2, 1, 10))
		self.assertTupleEqual (reconstructor.calculate3DCoordinate ((7.5, 5), 10), (-1, -0.5, 10))

@@ -72,17 +72,16 @@
 ructor%0A%0A
-%0A
 class Te
@@ -111,17 +111,11 @@
 e):%0A
-    %0A    
+%09%0A%09
 def 
@@ -148,24 +148,18 @@
 (self):%0A
-        
+%09%09
 reconstr
@@ -181,21 +181,21 @@
 ructor((
-20, 1
+10, 2
 0), 1, 1
@@ -196,24 +196,18 @@
 , 1, 1)%0A
-        
+%09%09
 self.ass
@@ -271,32 +271,26 @@
 , (-10, 5))%0A
-        
+%09%09
 self.assertT
@@ -353,24 +353,18 @@
 (0, 0))%0A
-        
+%09%09
 self.ass
@@ -430,32 +430,26 @@
 , (10, -5))%0A
-        
+%09%09
 self.assertT
@@ -519,16 +519,10 @@
 5))%0A
-        
+%09%09
 self
@@ -603,12 +603,9 @@
 ))%0A%0A
-    
+%09
 def 

Update Reconstructor test cases