Esempio n. 1
0
    def test_set_current_stratum_is_first_0_value_set_accordingly(self):
        # Arrange
        server = CP2Server('', '')
        server.payload_bits = '0'

        # Act
        server.set_current_stratum()

        # Assert
        self.assertEqual(CP2_ZERO_BITS[0], server.current_stratum)
Esempio n. 2
0
    def test_set_current_stratum_zero_different_set_accordingly(self):
        # Arrange
        server = CP2Server('', '')
        server.payload_bits = '10'

        # Act
        server.set_current_stratum()
        server.set_current_stratum()

        # Assert
        self.assertEqual(CP2_ZERO_BITS[0], server.current_stratum)
Esempio n. 3
0
    def test_set_current_stratum_one_toogle_set_accordingly(self):
        # Arrange
        server = CP2Server('', '')
        server.payload_bits = '11'

        # Act
        server.set_current_stratum()
        server.set_current_stratum()

        # Assert
        self.assertEqual(CP2_ONE_BITS[1], server.current_stratum)