#NEWLINE# def testSupportedOS( self ) : #NEWLINE# #INDENT# 'Test supported_os inside the collector object.' #NEWLINE# client_mock = action_mocks . ActionMock ( 'ListProcesses' ) #NEWLINE# coll1 = artifact_registry . ArtifactSource ( type = artifact_registry . ArtifactSource . SourceType . GRR_CLIENT_ACTION , attributes = { #NEWLINE# #INDENT# 'client_action' : 'ListProcesses' , #NEWLINE# #UNINDENT# } , supported_os = [ 'Windows' ] ) #NEWLINE# self . fakeartifact . sources . append ( coll1 ) #NEWLINE# fd = self . _RunClientActionArtifact ( client_mock , [ 'FakeArtifact' ] ) #NEWLINE# self . assertEqual ( fd . __class__ . __name__ , 'AFF4Volume' ) #NEWLINE# coll1 . conditions = [ ] #NEWLINE# coll1 . supported_os = [ 'Linux' , 'Windows' ] #NEWLINE# self . fakeartifact . sources = [ ] #NEWLINE# self . fakeartifact . sources . append ( coll1 ) #NEWLINE# fd = self . _RunClientActionArtifact ( client_mock , [ 'FakeArtifact' ] ) #NEWLINE# self . assertEqual ( fd . __class__ . __name__ , 'RDFValueCollection' ) #NEWLINE# coll1 . conditions = [ "os == 'Linux' or os == 'Windows'" ] #NEWLINE# coll1 . supported_os = [ 'NotTrue' ] #NEWLINE# self . fakeartifact . sources = [ ] #NEWLINE# self . fakeartifact . sources . append ( coll1 ) #NEWLINE# fd = self . _RunClientActionArtifact ( client_mock , [ 'FakeArtifact' ] ) #NEWLINE# self . assertEqual ( fd . __class__ . __name__ , 'AFF4Volume' )