import unittest

from go import Array, ArrayError


class ArrayTest(unittest.TestCase):

    def test_init(self):
        a = Array(4, 3, 0)

        self.assertEqual(a._width, 4)
        self.assertEqual(a._height, 3)
        self.assertEqual(a._empty, 0)

        self.assertEqual(
            a._array,
            [
                [0, 0, 0, 0],
                [0, 0, 0, 0],
                [0, 0, 0, 0],
            ],
        )

    def test_get_or_set_index(self):
        a = Array(4, 3, 0)

        a[(1, 1)] = 1
        a[(3, 1)] = 2

        self.assertEqual(
            a._array,
            [
                [1, 0, 2, 0],
                [0, 0, 0, 0],
                [0, 0, 0, 0],
            ],
        )

        self.assertEqual(a[(1, 1)], 1)
        self.assertEqual(a[(2, 1)], 0)

    def test_get_or_set_invalid_index(self):
        a = Array(4, 3, 0)

        self.assertRaises(ArrayError, a.__getitem__, (10, 10))
        self.assertRaises(ArrayError, a.__setitem__, (10, 10), 10)

    def test_equality(self):
        a1 = Array(4, 3, 0)
        a2 = Array(4, 3, 0)
        a3 = Array(4, 3, 0)

        a1[(1, 1)] = 1
        a2[(1, 1)] = 1

        self.assertEqual(a1, a2)
        self.assertNotEqual(a1, a3)

        a4 = Array(5, 5)
        a5 = Array(12, 34)

        self.assertNotEqual(a4, a5)

@@ -504,22 +504,20 @@
       a%5B
-(
 1, 1
-)
 %5D = 1%0A  
@@ -528,14 +528,12 @@
   a%5B
-(
 3, 1
-)
 %5D = 
@@ -740,22 +740,20 @@
 Equal(a%5B
-(
 1, 1
-)
 %5D, 1)%0A  
@@ -781,14 +781,12 @@
 l(a%5B
-(
 2, 1
-)
 %5D, 0
@@ -1117,22 +1117,20 @@
      a1%5B
-(
 1, 1
-)
 %5D = 1%0A  
@@ -1142,14 +1142,12 @@
  a2%5B
-(
 1, 1
-)
 %5D = 

Update array_test.py