Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_address2index(self):
self.assertEqual(address2index('A1'), [1, 1])
self.assertEqual(address2index('A1000'), [1000, 1])
self.assertEqual(address2index('A1048576'), [1048576, 1])
self.assertEqual(address2index('Z1'), [1, 26])
self.assertEqual(address2index('AA1'), [1, 27])
self.assertEqual(address2index('BA1'), [1, 53])
self.assertEqual(address2index('YQ1'), [1, 667])
self.assertEqual(address2index('AAA1'), [1, 703])
self.assertEqual(address2index('PZD1'), [1, 11496])
self.assertEqual(address2index('QGK1'), [1, 11685])
self.assertEqual(address2index('XFD1'), [1, 16384])
self.assertEqual(address2index('XFD1048576'), [1048576, 16384])
def test_address2index(self):
self.assertEqual(address2index('A1'), [1, 1])
self.assertEqual(address2index('A1000'), [1000, 1])
self.assertEqual(address2index('A1048576'), [1048576, 1])
self.assertEqual(address2index('Z1'), [1, 26])
self.assertEqual(address2index('AA1'), [1, 27])
self.assertEqual(address2index('BA1'), [1, 53])
self.assertEqual(address2index('YQ1'), [1, 667])
self.assertEqual(address2index('AAA1'), [1, 703])
self.assertEqual(address2index('PZD1'), [1, 11496])
self.assertEqual(address2index('QGK1'), [1, 11685])
self.assertEqual(address2index('XFD1'), [1, 16384])
self.assertEqual(address2index('XFD1048576'), [1048576, 16384])
with self.assertRaises(ValueError) as e:
address2index('')
self.assertEqual(e, 'Error - Address ('') cannot be an empty str.')
with self.assertRaises(ValueError) as e:
address2index('1')
self.assertEqual(e, 'Error - Incorrect address (1) entry. Address must be an alphanumeric '
'where the starting character(s) are alpha characters a-z')
with self.assertRaises(ValueError) as e:
address2index('1A')
self.assertEqual(e, 'Error - Incorrect address (1A) entry. Address must be an alphanumeric '
'where the starting character(s) are alpha characters a-z')
with self.assertRaises(ValueError) as e:
address2index('AA')
self.assertEqual(e, 'Error - Incorrect address (AA) entry. Address must be an alphanumeric '
'where the trailing character(s) are numeric characters 1-9')
def test_address2index(self):
self.assertEqual(address2index('A1'), [1, 1])
self.assertEqual(address2index('A1000'), [1000, 1])
self.assertEqual(address2index('A1048576'), [1048576, 1])
self.assertEqual(address2index('Z1'), [1, 26])
self.assertEqual(address2index('AA1'), [1, 27])
self.assertEqual(address2index('BA1'), [1, 53])
self.assertEqual(address2index('YQ1'), [1, 667])
self.assertEqual(address2index('AAA1'), [1, 703])
self.assertEqual(address2index('PZD1'), [1, 11496])
self.assertEqual(address2index('QGK1'), [1, 11685])
self.assertEqual(address2index('XFD1'), [1, 16384])
self.assertEqual(address2index('XFD1048576'), [1048576, 16384])
def test_address2index(self):
self.assertEqual(address2index('A1'), [1, 1])
self.assertEqual(address2index('A1000'), [1000, 1])
self.assertEqual(address2index('A1048576'), [1048576, 1])
self.assertEqual(address2index('Z1'), [1, 26])
self.assertEqual(address2index('AA1'), [1, 27])
self.assertEqual(address2index('BA1'), [1, 53])
self.assertEqual(address2index('YQ1'), [1, 667])
self.assertEqual(address2index('AAA1'), [1, 703])
self.assertEqual(address2index('PZD1'), [1, 11496])
self.assertEqual(address2index('QGK1'), [1, 11685])
self.assertEqual(address2index('XFD1'), [1, 16384])
self.assertEqual(address2index('XFD1048576'), [1048576, 16384])
def test_address2index(self):
self.assertEqual(address2index('A1'), [1, 1])
self.assertEqual(address2index('A1000'), [1000, 1])
self.assertEqual(address2index('A1048576'), [1048576, 1])
self.assertEqual(address2index('Z1'), [1, 26])
self.assertEqual(address2index('AA1'), [1, 27])
self.assertEqual(address2index('BA1'), [1, 53])
self.assertEqual(address2index('YQ1'), [1, 667])
self.assertEqual(address2index('AAA1'), [1, 703])
self.assertEqual(address2index('PZD1'), [1, 11496])
self.assertEqual(address2index('QGK1'), [1, 11685])
self.assertEqual(address2index('XFD1'), [1, 16384])
self.assertEqual(address2index('XFD1048576'), [1048576, 16384])
def test_address2index(self):
self.assertEqual(address2index('A1'), [1, 1])
self.assertEqual(address2index('A1000'), [1000, 1])
self.assertEqual(address2index('A1048576'), [1048576, 1])
self.assertEqual(address2index('Z1'), [1, 26])
self.assertEqual(address2index('AA1'), [1, 27])
self.assertEqual(address2index('BA1'), [1, 53])
self.assertEqual(address2index('YQ1'), [1, 667])
self.assertEqual(address2index('AAA1'), [1, 703])
self.assertEqual(address2index('PZD1'), [1, 11496])
self.assertEqual(address2index('QGK1'), [1, 11685])
self.assertEqual(address2index('XFD1'), [1, 16384])
self.assertEqual(address2index('XFD1048576'), [1048576, 16384])
def test_address2index(self):
self.assertEqual(address2index('A1'), [1, 1])
self.assertEqual(address2index('A1000'), [1000, 1])
self.assertEqual(address2index('A1048576'), [1048576, 1])
self.assertEqual(address2index('Z1'), [1, 26])
self.assertEqual(address2index('AA1'), [1, 27])
self.assertEqual(address2index('BA1'), [1, 53])
self.assertEqual(address2index('YQ1'), [1, 667])
self.assertEqual(address2index('AAA1'), [1, 703])
self.assertEqual(address2index('PZD1'), [1, 11496])
self.assertEqual(address2index('QGK1'), [1, 11685])
self.assertEqual(address2index('XFD1'), [1, 16384])
self.assertEqual(address2index('XFD1048576'), [1048576, 16384])
def test_address2index(self):
self.assertEqual(address2index('A1'), [1, 1])
self.assertEqual(address2index('A1000'), [1000, 1])
self.assertEqual(address2index('A1048576'), [1048576, 1])
self.assertEqual(address2index('Z1'), [1, 26])
self.assertEqual(address2index('AA1'), [1, 27])
self.assertEqual(address2index('BA1'), [1, 53])
self.assertEqual(address2index('YQ1'), [1, 667])
self.assertEqual(address2index('AAA1'), [1, 703])
self.assertEqual(address2index('PZD1'), [1, 11496])
self.assertEqual(address2index('QGK1'), [1, 11685])
self.assertEqual(address2index('XFD1'), [1, 16384])
self.assertEqual(address2index('XFD1048576'), [1048576, 16384])
def test_address2index(self):
self.assertEqual(address2index('A1'), [1, 1])
self.assertEqual(address2index('A1000'), [1000, 1])
self.assertEqual(address2index('A1048576'), [1048576, 1])
self.assertEqual(address2index('Z1'), [1, 26])
self.assertEqual(address2index('AA1'), [1, 27])
self.assertEqual(address2index('BA1'), [1, 53])
self.assertEqual(address2index('YQ1'), [1, 667])
self.assertEqual(address2index('AAA1'), [1, 703])
self.assertEqual(address2index('PZD1'), [1, 11496])
self.assertEqual(address2index('QGK1'), [1, 11685])
self.assertEqual(address2index('XFD1'), [1, 16384])
self.assertEqual(address2index('XFD1048576'), [1048576, 16384])