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" ]))
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" ]))
def test_check_path_2(self): self.assertTrue( CABRuleTools.check_path("BTC.CAB.Commons.Core", "BTC/CAB/Commons/Core", pathmodule=posixpath))
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))
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))
def test_get_rparts_5(self): self.assertEqual( "Core", CABRuleTools.get_dirshort("Core", 2, pathmodule=posixpath))
def test_get_rparts_3(self): self.assertEqual( posixpath.sep.join(("Commons", "Core")), CABRuleTools.get_dirshort("a/BTC/Commons/Core", 2, pathmodule=posixpath))
def test_get_rparts_2(self): self.assertEqual( "Core", CABRuleTools.get_dirshort("a/BTC/Commons/Core", 1, pathmodule=posixpath))
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)))
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"))
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"))
def test_check_path_6(self): self.assertFalse( CABRuleTools.check_path("BTC.CAB.Commons.Core", "/Core", pathmodule=posixpath))
def test_check_path_5(self): self.assertTrue( CABRuleTools.check_path("BTC.Application.Test", "BTC\Application\Test", strict=False, pathmodule=ntpath))
def test_check_path_2_unicode(self): self.assertTrue( CABRuleTools.check_path(unicode("BTC.CAB.Commons.Core"), unicode("BTC/CAB/Commons/Core"), pathmodule=posixpath))