def test_init_display_blue(self):
        # set one tube
        number_of_tubes_in_display = 1
        display = SmartNixieTubeDisplay(number_of_tubes_in_display,
                                        serial_port_name=self.inputPort)

        display.blue = 128
        self.assertEqual('$-,N,N,000,000,000,128!',
                         display.generate_command_string())

        # set two tubes
        number_of_tubes_in_display = 2
        display2 = SmartNixieTubeDisplay(number_of_tubes_in_display,
                                         serial_port_name=self.inputPort)

        display2.blue = 128
        self.assertEqual('$-,N,N,000,000,000,128$-,N,N,000,000,000,128!',
                         display2.generate_command_string())

        # set three tubes
        number_of_tubes_in_display = 3
        display3 = SmartNixieTubeDisplay(number_of_tubes_in_display,
                                         serial_port_name=self.inputPort)

        display3.blue = 128
        self.assertEqual(
            '$-,N,N,000,000,000,128$-,N,N,000,000,000,128$-,N,N,000,000,000,128!',
            display3.generate_command_string())
    def test_SmartNixieTubeDisplay_set_three_tube_display_numbers(self):
        # set three tubes
        number_of_tubes_in_display = 3
        display3 = SmartNixieTubeDisplay(number_of_tubes_in_display,
                                         serial_port_name=self.inputPort)

        display3.set_display_number(9)
        self.assertEqual(
            '$9,N,N,000,000,000,000$0,N,N,000,000,000,000$0,N,N,000,000,000,000!',
            display3.generate_command_string())

        display3.set_display_number(99)
        self.assertEqual(
            '$9,N,N,000,000,000,000$9,N,N,000,000,000,000$0,N,N,000,000,000,000!',
            display3.generate_command_string())

        display3.set_display_number(909)
        self.assertEqual(
            '$9,N,N,000,000,000,000$0,N,N,000,000,000,000$9,N,N,000,000,000,000!',
            display3.generate_command_string())

        display3.set_display_number(990)
        self.assertEqual(
            '$0,N,N,000,000,000,000$9,N,N,000,000,000,000$9,N,N,000,000,000,000!',
            display3.generate_command_string())
    def test_SmartNixieTubeDisplay_set_two_tube_display_numbers(self):
        # set two tubes
        number_of_tubes_in_display = 2
        display2 = SmartNixieTubeDisplay(number_of_tubes_in_display, serial_port_name=self.inputPort)

        display2.set_display_number(9)
        self.assertEqual('$9,N,N,000,000,000,000$0,N,N,000,000,000,000!', display2.generate_command_string())

        display2.set_display_number(90)
        self.assertEqual('$0,N,N,000,000,000,000$9,N,N,000,000,000,000!', display2.generate_command_string())

        display2.set_display_number(99)
        self.assertEqual('$9,N,N,000,000,000,000$9,N,N,000,000,000,000!', display2.generate_command_string())
    def test_SmartNixieTubeDisplay_set_one_tube_display_numbers(self):
        # set one tube
        number_of_tubes_in_display = 1
        display = SmartNixieTubeDisplay(number_of_tubes_in_display, serial_port_name=self.inputPort)

        display.set_display_number(9)
        self.assertEqual('$9,N,N,000,000,000,000!', display.generate_command_string())
    def test_SmartNixieTubeDisplay_2tubes_generateCommandString(self):
        number_of_tubes_in_display = 2
        display = SmartNixieTubeDisplay(number_of_tubes_in_display,
                                        serial_port_name=self.inputPort)

        self.assertEqual('$-,N,N,000,000,000,000$-,N,N,000,000,000,000!',
                         display.generate_command_string())
    def test_SmartNixieTubeDisplay_set_one_tube_display_numbers(self):
        # set one tube
        number_of_tubes_in_display = 1
        display = SmartNixieTubeDisplay(number_of_tubes_in_display,
                                        serial_port_name=self.inputPort)

        display.set_display_number(9)
        self.assertEqual('$9,N,N,000,000,000,000!',
                         display.generate_command_string())
    def test_SmartNixieTubeDisplay_3tubes_nonDefault_generateCommandString(self):
        number_of_tubes_in_display = 3
        display = SmartNixieTubeDisplay(number_of_tubes_in_display, serial_port_name=self.inputPort)

        display.tubes[0].digit = '0'
        display.tubes[1].digit = '1'
        display.tubes[2].digit = '2'

        self.assertEqual('$2,N,N,000,000,000,000$1,N,N,000,000,000,000$0,N,N,000,000,000,000!',
                         display.generate_command_string())
    def test_init_display_blue(self):
        # set one tube
        number_of_tubes_in_display = 1
        display = SmartNixieTubeDisplay(number_of_tubes_in_display, serial_port_name=self.inputPort)

        display.blue = 128
        self.assertEqual('$-,N,N,000,000,000,128!', display.generate_command_string())

        # set two tubes
        number_of_tubes_in_display = 2
        display2 = SmartNixieTubeDisplay(number_of_tubes_in_display, serial_port_name=self.inputPort)

        display2.blue = 128
        self.assertEqual('$-,N,N,000,000,000,128$-,N,N,000,000,000,128!', display2.generate_command_string())

        # set three tubes
        number_of_tubes_in_display = 3
        display3 = SmartNixieTubeDisplay(number_of_tubes_in_display, serial_port_name=self.inputPort)

        display3.blue = 128
        self.assertEqual('$-,N,N,000,000,000,128$-,N,N,000,000,000,128$-,N,N,000,000,000,128!',
                         display3.generate_command_string())
    def test_SmartNixieTubeDisplay_3tubes_nonDefault_generateCommandString(
            self):
        number_of_tubes_in_display = 3
        display = SmartNixieTubeDisplay(number_of_tubes_in_display,
                                        serial_port_name=self.inputPort)

        display.tubes[0].digit = '0'
        display.tubes[1].digit = '1'
        display.tubes[2].digit = '2'

        self.assertEqual(
            '$2,N,N,000,000,000,000$1,N,N,000,000,000,000$0,N,N,000,000,000,000!',
            display.generate_command_string())
    def test_SmartNixieTubeDisplay_3tubes_generateCommandString(self):
        number_of_tubes_in_display = 3
        display = SmartNixieTubeDisplay(number_of_tubes_in_display, serial_port_name=self.inputPort)

        self.assertEqual('$-,N,N,000,000,000,000$-,N,N,000,000,000,000$-,N,N,000,000,000,000!',
                         display.generate_command_string())