File tree Expand file tree Collapse file tree 2 files changed +17
-1
lines changed
Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change 1010LOGGER = get_logger ()
1111
1212
13+ def write_catalog (catalog ):
14+ # If the catalog has no streams, log a warning
15+ if not catalog .streams :
16+ LOGGER .warning ("Catalog being written with no streams." )
17+
18+ json .dump (catalog .to_dict (), sys .stdout , indent = 2 )
19+
1320# pylint: disable=too-many-instance-attributes
1421class CatalogEntry ():
1522
Original file line number Diff line number Diff line change 11import unittest
22
33from singer .schema import Schema
4- from singer .catalog import Catalog , CatalogEntry
4+ from singer .catalog import Catalog , CatalogEntry , write_catalog
5+
6+ class TestWriteCatalog (unittest .TestCase ):
7+ def test_write_empty_catalog (self ):
8+ catalog = Catalog ([])
9+ write_catalog (catalog )
10+
11+ def test_write_catalog_with_streams (self ):
12+ catalog = Catalog ([CatalogEntry (tap_stream_id = 'a' ,schema = Schema (),metadata = [])])
13+ write_catalog (catalog )
514
615class TestGetSelectedStreams (unittest .TestCase ):
716 def test_one_selected_stream (self ):
You can’t perform that action at this time.
0 commit comments