def test_display_non_verbose(self, stdout): locs = NumberedPoints(['Home', '52.168;0.040'], config_locations={'Home': (52.015, -0.221)}) locs.format = 'locator' locs.verbose = False locs.display('extsquare') expect(stdout.getvalue()) == 'IO92va33\nJO02ae40\n'
def test_display_non_verbose(self, capsys): locs = NumberedPoints(['Home', '52.168;0.040'], config_locations={'Home': (52.015, -0.221)}) locs.format = 'locator' locs.verbose = False locs.display('extsquare') assert capsys.readouterr()[0] == 'IO92va33\nJO02ae40\n'
def test_display_locator(self, stdout): locs = NumberedPoints(['Home', '52.168;0.040'], config_locations={'Home': (52.015, -0.221)}) locs.format = 'locator' locs.display('extsquare') expect(stdout.getvalue()) == ( 'Location Home is IO92va33\n' 'Location 2 is JO02ae40\n' )
def test_display_locator(self, capsys): locs = NumberedPoints(['Home', '52.168;0.040'], config_locations={'Home': (52.015, -0.221)}) locs.format = 'locator' locs.display('extsquare') assert capsys.readouterr()[0] == ( 'Location Home is IO92va33\n' 'Location 2 is JO02ae40\n' )
def test_display(self, capsys): locs = NumberedPoints(['Home', '52.168;0.040'], config_locations={'Home': (52.015, -0.221)}) locs.display(None) stdout = capsys.readouterr()[0] if PY2: stdout = stdout.encode('utf-8') assert stdout == ( "Location Home is 52°00.90'N, 000°13.26'W\n" "Location 2 is 52°10.08'N, 000°02.40'E\n" )
def test_display(self, stdout): locs = NumberedPoints(['Home', '52.168;0.040'], config_locations={'Home': (52.015, -0.221)}) locs.display(None) if PY2: expect(stdout.getvalue()) == ( "Location Home is 52\xc2\xb000.90'N, 000\xc2\xb013.26'W\n" "Location 2 is 52\xc2\xb010.08'N, 000\xc2\xb002.40'E\n" ) else: expect(stdout.getvalue()) == ( "Location Home is 52°00.90'N, 000°13.26'W\n" "Location 2 is 52°10.08'N, 000°02.40'E\n" )