def test_get_requirement_versions_with_requirements(self, mock_get_installed_dists):
        # Create some fake requirements
        mock_req = Mock(Requirement)
        mock_req.return_value.specs = [('>=', '1.0')]
        mock_req.return_value.project_name = 'req'

        # Create some fake distributions
        mock_dist = Mock(Distribution)
        mock_dist.return_value.requires.return_value = [
            mock_req(),
            mock_req()
        ]
        mock_dist.return_value.project_name = 'test'
        mock_get_installed_dists.return_value = [
            mock_dist(),
            mock_dist()
        ]

        checker = Checker()
        distributions = checker.get_requirement_versions()

        # Assert that the main dist has no requirements
        self.assertFalse(len(distributions['test']))

        # Assert that the req dist has requirements
        self.assertTrue(len(distributions['req']))
    def test_get_requirement_versions_with_requirements(self, mock_get_installed_dists):
        # Create some fake requirements
        mock_req = Mock(Requirement)
        mock_req.return_value.specs = [('>=', '1.0')]
        mock_req.return_value.project_name = 'req'

        # Create some fake distributions
        mock_dist = Mock(Distribution)
        mock_dist.return_value.requires.return_value = [
            mock_req(),
            mock_req()
        ]
        mock_dist.return_value.project_name = 'test'
        mock_get_installed_dists.return_value = [
            mock_dist(),
            mock_dist()
        ]

        checker = Checker()
        distributions = checker.get_requirement_versions()

        # Assert that the main dist has no requirements
        self.assertFalse(len(distributions['test']))

        # Assert that the req dist has requirements
        self.assertTrue(len(distributions['req']))
 def test_get_requirement_versions(self):
     checker = Checker()
     distributions = checker.get_requirement_versions()
     for dist in self.expected_distributions:
         self.assertIn(dist, distributions)
 def test_get_requirement_versions(self):
     checker = Checker()
     distributions = checker.get_requirement_versions()
     for dist in self.expected_distributions:
         self.assertIn(dist, distributions)