@@ -23,7 +23,12 @@ def mock_config_location():
2323
2424@pytest .fixture ()
2525def _mock_config (mock_config_location ):
26- config = Config (organization_slug = "test_org" , project_slug = "test_project" , token = "test_token" )
26+ config = Config (
27+ organization_slug = "test_org" ,
28+ project_slug = "test_project" ,
29+ token = "test_token" ,
30+ tags = {"env" : "prod" , "host" : "localhost" },
31+ )
2732 write_config (config )
2833
2934
@@ -67,7 +72,7 @@ def test_info_args_trump_env():
6772@pytest .mark .usefixtures ("_mock_config" )
6873def test_info_config ():
6974 result = runner .invoke (app , ["info" ])
70- _check_output (result , "test_org" , "test_project" , "test_token" )
75+ _check_output (result , "test_org" , "test_project" , "test_token" , tags = { "env" : "prod" , "host" : "localhost" } )
7176
7277
7378@mock .patch .dict (
@@ -82,13 +87,13 @@ def test_info_config():
8287@pytest .mark .usefixtures ("_mock_config" )
8388def test_info_config_env ():
8489 result = runner .invoke (app , ["info" ])
85- _check_output (result , "org2" , "project2" , "token2" )
90+ _check_output (result , "org2" , "project2" , "token2" , tags = { "env" : "prod" , "host" : "localhost" } )
8691
8792
8893@pytest .mark .usefixtures ("_mock_config" )
8994def test_info_config_args ():
9095 result = runner .invoke (app , ["-o" , "org1" , "-p" , "project1" , "info" ])
91- _check_output (result , "org1" , "project1" , "test_token" )
96+ _check_output (result , "org1" , "project1" , "test_token" , tags = { "env" : "prod" , "host" : "localhost" } )
9297
9398
9499@mock .patch .dict (
@@ -103,7 +108,7 @@ def test_info_config_args():
103108@pytest .mark .usefixtures ("_mock_config" )
104109def test_info_config_env_args ():
105110 result = runner .invoke (app , ["-o" , "org1" , "-p" , "project1" , "info" ])
106- _check_output (result , "org1" , "project1" , "token2" )
111+ _check_output (result , "org1" , "project1" , "token2" , tags = { "env" : "prod" , "host" : "localhost" } )
107112
108113
109114def test_configure (mock_config_location ):
@@ -122,8 +127,13 @@ def test_configure(mock_config_location):
122127 }
123128
124129
125- def _check_output (result , org , project , token ):
130+ def _check_output (result , org , project , token , tags = None ):
126131 assert result .exit_code == 0
127132 assert f"Organization slug: { org } " in result .stdout
128133 assert f"Project slug: { project } " in result .stdout
129134 assert f"Auth token: { token } " in result .stdout
135+ if tags :
136+ for key , value in tags .items ():
137+ assert f"{ key } : { value } " in result .stdout
138+ else :
139+ assert "Tags:" not in result .stdout
0 commit comments