Пример #1
0
 def test_count_distinct_files_1(self):
     self.assertEquals(
         1,
         CABRuleTools.count_distinct_files([
             "BTC/TimeSeries/CommonsExtensions/BTC.CAB.TimeSeries.NET.CommonsExtensions.csproj",
             "BTC/TimeSeries/CommonsExtensions/BTC.CAB.TimeSeries.NET.CommonsExtensions.3.5.csproj"
         ]))
Пример #2
0
 def test_count_distinct_files_2(self):
     self.assertEquals(
         2,
         CABRuleTools.count_distinct_files([
             "BTC\TimeSeries\API\Test\ObservableProvider\BTC.CAB.TimeSeries.NET.API.Test.ObservableProvider.csproj",
             "BTC\TimeSeries\API\Test\DecoratorProvider\BTC.CAB.TimeSeries.NET.API.Test.DecoratorProvider.csproj"
         ]))
Пример #3
0
 def test_check_path_2(self):
     self.assertTrue(
         CABRuleTools.check_path("BTC.CAB.Commons.Core",
                                 "BTC/CAB/Commons/Core",
                                 pathmodule=posixpath))
Пример #4
0
 def test_check_path_longer_prefix_mixed_path(self):
     self.assertTrue(
         CABRuleTools.check_path("BTC.CAB.Commons.Core.TimeSeries",
                                 "a/BTC/CAB/Commons.Core/TimeSeries",
                                 pathmodule=posixpath))
Пример #5
0
 def test_check_path_longer_all_mixed_path(self):
     self.assertTrue(
         CABRuleTools.check_path("X.Y.Commons.Core",
                                 "a/X.Y.Commons.Core",
                                 pathmodule=posixpath))
Пример #6
0
 def test_get_rparts_5(self):
     self.assertEqual(
         "Core", CABRuleTools.get_dirshort("Core", 2, pathmodule=posixpath))
Пример #7
0
 def test_get_rparts_3(self):
     self.assertEqual(
         posixpath.sep.join(("Commons", "Core")),
         CABRuleTools.get_dirshort("a/BTC/Commons/Core",
                                   2,
                                   pathmodule=posixpath))
Пример #8
0
 def test_get_rparts_2(self):
     self.assertEqual(
         "Core",
         CABRuleTools.get_dirshort("a/BTC/Commons/Core",
                                   1,
                                   pathmodule=posixpath))
Пример #9
0
 def test_get_correct_directory_1(self):
     candidates = list(
         CABRuleTools.get_correct_directory("BTC.CAB.TimeSeries.NET.API"))
     self.assertTrue(len(candidates) > 0)
     self.assertEquals(
         0, len(filter(lambda x: x.find("BTC.CAB") >= 0, candidates)))
Пример #10
0
 def test_transform_project_file_name_3(self):
     # current variant 1
     self.assertEquals(
         "BTC.CAB.TimeSeries.NET.API",
         CABRuleTools.transform_project_file_name(
             "BTC.CAB.TimeSeries.NET.3.5.API.csproj"))
Пример #11
0
 def test_transform_project_file_name_1(self):
     # new guideline
     self.assertEquals(
         "BTC.CAB.TimeSeries.NET.API",
         CABRuleTools.transform_project_file_name(
             "BTC.CAB.TimeSeries.NET.API-net3.5.csproj"))
Пример #12
0
 def test_check_path_6(self):
     self.assertFalse(
         CABRuleTools.check_path("BTC.CAB.Commons.Core",
                                 "/Core",
                                 pathmodule=posixpath))
Пример #13
0
 def test_check_path_5(self):
     self.assertTrue(
         CABRuleTools.check_path("BTC.Application.Test",
                                 "BTC\Application\Test",
                                 strict=False,
                                 pathmodule=ntpath))
Пример #14
0
 def test_check_path_2_unicode(self):
     self.assertTrue(
         CABRuleTools.check_path(unicode("BTC.CAB.Commons.Core"),
                                 unicode("BTC/CAB/Commons/Core"),
                                 pathmodule=posixpath))