def test_positional_inferrence(self): self.assertEqual(parse_dimensions('1in, 2in'), (72, 144)) self.assertEqual(parse_dimensions('1, 2in'), (72, 144)) self.assertEqual(parse_dimensions('1, 2'), (1, 2)) self.assertEqual(parse_dimensions('1in, 2, 3in'), (72, 2, 216)) self.assertEqual(parse_dimensions('1, 2, 3in'), (72, 144, 216))
def test_separators(self): self.assertEqual(parse_dimensions('1x2'), (1, 2)) self.assertEqual(parse_dimensions('1inx2in'), (72, 144)) self.assertEqual(parse_dimensions('1in x 2in'), (72, 144)) self.assertEqual(parse_dimensions('1in x2in'), (72, 144)) self.assertEqual(parse_dimensions('1inx 2in'), (72, 144)) self.assertEqual(parse_dimensions('1in 2in'), (72, 144)) self.assertEqual(parse_dimensions('1in, 2in'), (72, 144)) self.assertEqual(parse_dimensions('1in,2in'), (72, 144)) self.assertEqual(parse_dimensions('1in; 2in'), (72, 144)) self.assertEqual(parse_dimensions('1in;2in'), (72, 144)) self.assertEqual(parse_dimensions('1in-2in'), (72, 144))