Пример #1
0
    def test_parse_simple_request(self):
        result = PathUtils.parse_request("/my/value")

        self.assertTrue(result.Path == "/my/value")
        self.assertTrue(result.WasParsedPath)
        self.assertFalse(result.WasParsedRunNumber)
        self.assertFalse(result.WasParsedVariation)
        self.assertFalse(result.WasParsedTime)
Пример #2
0
    def test_parse_simple_request(self):
        result= PathUtils.parse_request("/my/value");

        self.assertTrue(result.Path == "/my/value")
        self.assertTrue(result.WasParsedPath)
        self.assertFalse(result.WasParsedRunNumber)
        self.assertFalse(result.WasParsedVariation)
        self.assertFalse(result.WasParsedTime)
Пример #3
0
    def test_parse_partial_request(self):
        """ * * * parse partial request  * * * """

        result = PathUtils.parse_request("/my/value::mc")

        self.assertTrue(result.Path == "/my/value")
        self.assertTrue(result.WasParsedPath)
        self.assertFalse(result.WasParsedRunNumber)
        self.assertTrue(result.Variation == "mc")
        self.assertTrue(result.WasParsedVariation)
        self.assertFalse(result.WasParsedTime)
Пример #4
0
    def test_parse_partial_request(self):
        """ * * * parse partial request  * * * """
            
        result= PathUtils.parse_request("/my/value::mc")

        self.assertTrue(result.Path == "/my/value")
        self.assertTrue(result.WasParsedPath)
        self.assertFalse(result.WasParsedRunNumber)
        self.assertTrue(result.Variation == "mc")
        self.assertTrue(result.WasParsedVariation)
        self.assertFalse(result.WasParsedTime)
Пример #5
0
    def test_parse_full_request(self):
        """ parse full request """

        result = PathUtils.parse_request("/my/value:100:mc:2029")

        #now check
        self.assertTrue(result.Path == "/my/value")
        self.assertTrue(result.WasParsedPath)
        self.assertTrue(result.RunNumber == 100)
        self.assertFalse(result.IsInvalidRunNumber)
        self.assertTrue(result.WasParsedRunNumber)
        self.assertTrue(result.Variation == "mc")
        self.assertTrue(result.WasParsedVariation)
        self.assertTrue(result.Time != 0)
        self.assertTrue(result.WasParsedTime)
Пример #6
0
    def test_parse_full_request(self):
        """ parse full request """

        result= PathUtils.parse_request("/my/value:100:mc:2029");

        #now check
        self.assertTrue(result.Path == "/my/value")
        self.assertTrue(result.WasParsedPath)
        self.assertTrue(result.RunNumber == 100)
        self.assertFalse(result.IsInvalidRunNumber)
        self.assertTrue(result.WasParsedRunNumber)
        self.assertTrue(result.Variation == "mc")
        self.assertTrue(result.WasParsedVariation)
        self.assertTrue(result.Time != 0)
        self.assertTrue(result.WasParsedTime)
Пример #7
0
    def test_parse_partial_time(self):
        result = time.localtime(PathUtils.parse_time("2029"))

        self.assertIsNotNone(result)
        self.assertIsInstance(result, time.struct_time)
        self.assertEqual(result.tm_year, 2029)
Пример #8
0
    def test_parse_partial_time(self):
        result = time.localtime(PathUtils.parse_time("2029"))

        self.assertIsNotNone(result)        
        self.assertIsInstance(result, time.struct_time)
        self.assertEqual(result.tm_year, 2029)