'Test supported_os inside the collector object.'

def testSupportedOS(self):

    with utils.Stubber(psutil, 'process_iter', ProcessIter):
        client_mock = action_mocks.ActionMock(standard.ListProcesses)
        coll1 = artifact_registry.ArtifactSource(type=artifact_registry.ArtifactSource.SourceType.GRR_CLIENT_ACTION, attributes={'client_action': standard.ListProcesses.__name__}, supported_os=['Windows'])
        self.fakeartifact.sources.append(coll1)
        fd = self._RunClientActionArtifact(client_mock, ['FakeArtifact'])
        self.assertEqual(fd.__class__, sequential_collection.GeneralIndexedCollection)
        self.assertEqual(len(fd), 0)
        coll1.conditions = []
        coll1.supported_os = ['Linux', 'Windows']
        self.fakeartifact.sources = []
        self.fakeartifact.sources.append(coll1)
        fd = self._RunClientActionArtifact(client_mock, ['FakeArtifact'])
        self.assertEqual(fd.__class__, sequential_collection.GeneralIndexedCollection)
        self.assertNotEqual(len(fd), 0)
        coll1.conditions = ["os    ==    'Linux'    or    os    ==    'Windows'"]
        coll1.supported_os = ['NotTrue']
        self.fakeartifact.sources = []
        self.fakeartifact.sources.append(coll1)
        fd = self._RunClientActionArtifact(client_mock, ['FakeArtifact'])
        self.assertEqual(fd.__class__, sequential_collection.GeneralIndexedCollection)
        self.assertEqual(len(fd), 0)
