File tree Expand file tree Collapse file tree 2 files changed +1
-28
lines changed
Expand file tree Collapse file tree 2 files changed +1
-28
lines changed Original file line number Diff line number Diff line change 77LOGGER = get_logger ()
88
99
10- def write_state (state ):
11- json .dump (state .to_dict (), sys .stdout , indent = 2 )
12-
13-
1410class State :
1511 def __init__ (
1612 self , bookmarks : Optional [Dict ] = None , currently_syncing : Optional [str ] = None # pylint: disable=bad-continuation
Original file line number Diff line number Diff line change 11from copy import copy
22import unittest
3- from singer .bookmarks import State , write_state
4-
5-
6- class TestWriteState (unittest .TestCase ):
7- def test_write_empty_state (self ):
8- state = State ()
9- write_state (state )
10-
11- def test_write_state_with_bookmarks (self ):
12- stream_id_1 = "customers"
13- bookmark_key_1 = "datetime"
14- bookmark_val_1 = 123456789
15- offset_key = "key"
16- offset_val = "fizzy water"
17-
18- bookmarks = {
19- stream_id_1 : {
20- bookmark_key_1 : bookmark_val_1 ,
21- "offset" : {offset_key : offset_val },
22- }
23- }
24-
25- state = State (bookmarks = bookmarks , currently_syncing = "customers" )
26- write_state (state )
3+ from singer .bookmarks import State
274
285
296class TestGetBookmark (unittest .TestCase ):
You can’t perform that action at this time.
0 commit comments