Skip to content

Commit

Permalink
feat(gcssource): add support for a GCS bucket source
Browse files Browse the repository at this point in the history
The blobs in GCS are expected to be plain passwd, group, and shadow
files so the FilesMapParser can be used.
  • Loading branch information
zachburg committed Apr 19, 2023
1 parent 607b774 commit 1c9bb19
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions nss_cache/sources/gcssource_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import unittest

from google.cloud import storage
from mox3 import mox

from nss_cache.maps import group
Expand Down Expand Up @@ -68,11 +67,13 @@ def testShadowGetUpdatesWithContent(self):
""")
mock_bucket = self.mox.CreateMockAnything()
mock_bucket.blob('passwd').AndReturn(mock_blob)
self.mox.StubOutWithMock(storage.Client, 'bucket')
storage.Client.bucket('test-bucket').AndReturn(mock_bucket)

mock_client = self.mox.CreateMockAnything()
mock_client.bucket('test-bucket').AndReturn(mock_bucket)

self.mox.ReplayAll()
result = self.updater.GetUpdates(storage.Client(), 'test-bucket',
'passwd')

result = self.updater.GetUpdates(mock_client, 'test-bucket', 'passwd')
self.assertEqual(len(result), 2)


Expand Down

0 comments on commit 1c9bb19

Please sign in to comment.