예제 #1
0
 def testMappingPassNew(self):
     with mock.patch(open_name, create=True) as mock_open:
         mock_open.return_value = mock_file(BASIC)
         with mock.patch('owners_file_tags.open',
                         create=True) as mock_open_2:
             mock_open_2.return_value = mock_file(BASIC)
             self.assertEqual(0, checkteamtags.main())
예제 #2
0
 def testBasic(self):
     with mock.patch(open_name, create=True) as mock_open:
         mock_open.return_value = mock_file(BASIC)
         self.assertEqual(0, checkteamtags.main())
예제 #3
0
 def testMultipleTeamsInTag(self):
     with mock.patch(open_name, create=True) as mock_open:
         mock_open.return_value = mock_file(MULTIPLE_TEAMS_IN_TAG)
         self.assertEqual(1, checkteamtags.main())
예제 #4
0
 def testMissingTeam(self):
     with mock.patch(open_name, create=True) as mock_open:
         mock_open.return_value = mock_file(MISSING_TEAM)
         self.assertEqual(1, checkteamtags.main())
예제 #5
0
 def testMissingComponent(self):
     with mock.patch(open_name, create=True) as mock_open:
         mock_open.return_value = mock_file(MISSING_COMPONENT)
         self.assertEqual(1, checkteamtags.main())
예제 #6
0
 def testMultipleComponentTags(self):
     with mock.patch(open_name, create=True) as mock_open:
         mock_open.return_value = mock_file(MULTIPLE_COMPONENT_TAGS)
         self.assertEqual(1, checkteamtags.main())
예제 #7
0
 def testNoTags(self):
     with mock.patch(open_name, create=True) as mock_open:
         mock_open.return_value = mock_file(NO_TAGS)
         self.assertEqual(0, checkteamtags.main())
예제 #8
0
 def testInvalidTeamPrefix3(self):
     with mock.patch(open_name, create=True) as mock_open:
         mock_open.return_value = mock_file(INVALID_TEAM_PREFIX3)
         self.assertEqual(1, checkteamtags.main())
예제 #9
0
 def testInvalidComponentPrefix2(self):
     with mock.patch(open_name, create=True) as mock_open:
         mock_open.return_value = mock_file(INVALID_COMPONENT_PREFIX2)
         self.assertEqual(1, checkteamtags.main())