Beispiel #1
0
    def test_set_config_file_all_entries(self):

        # Check set_config and get_config return the same values

        domain, streaming_domain, api, sharing = ('this', 'thing', 'that',
                                                  'private')
        ssl_verify, proxy_auth, world_readable, auto_open = (True, True, False,
                                                             False)
        tools.set_config_file(plotly_domain=domain,
                              plotly_streaming_domain=streaming_domain,
                              plotly_api_domain=api,
                              plotly_ssl_verification=ssl_verify,
                              plotly_proxy_authorization=proxy_auth,
                              world_readable=world_readable,
                              auto_open=auto_open)
        config = tools.get_config_file()
        self.assertEqual(config['plotly_domain'], domain)
        self.assertEqual(config['plotly_streaming_domain'], streaming_domain)
        self.assertEqual(config['plotly_api_domain'], api)
        self.assertEqual(config['plotly_ssl_verification'], ssl_verify)
        self.assertEqual(config['plotly_proxy_authorization'], proxy_auth)
        self.assertEqual(config['world_readable'], world_readable)
        self.assertEqual(config['sharing'], sharing)
        self.assertEqual(config['auto_open'], auto_open)
        tools.reset_config_file()
    def test_set_config_file_all_entries(self):

        # Check set_config and get_config return the same values

        domain, streaming_domain, api, sharing = ('this', 'thing',
                                                  'that', 'private')
        ssl_verify, proxy_auth, world_readable, auto_open = (True, True,
                                                             False, False)
        tools.set_config_file(plotly_domain=domain,
                              plotly_streaming_domain=streaming_domain,
                              plotly_api_domain=api,
                              plotly_ssl_verification=ssl_verify,
                              plotly_proxy_authorization=proxy_auth,
                              world_readable=world_readable,
                              auto_open=auto_open)
        config = tools.get_config_file()
        self.assertEqual(config['plotly_domain'], domain)
        self.assertEqual(config['plotly_streaming_domain'], streaming_domain)
        self.assertEqual(config['plotly_api_domain'], api)
        self.assertEqual(config['plotly_ssl_verification'], ssl_verify)
        self.assertEqual(config['plotly_proxy_authorization'], proxy_auth)
        self.assertEqual(config['world_readable'], world_readable)
        self.assertEqual(config['sharing'], sharing)
        self.assertEqual(config['auto_open'], auto_open)
        tools.reset_config_file()
def test_set_config_file():
    pd, ps = 'this', 'thing'
    tls.set_config_file(plotly_domain=pd, plotly_streaming_domain=ps)
    config = tls.get_config_file()
    assert config['plotly_domain'] == pd
    assert config['plotly_streaming_domain'] == ps
    tls.reset_config_file()  # else every would hate me :)
    def test_reset_config_file(self):

        # Check reset_config and get_config return the same values

        tools.reset_config_file()
        config = tools.get_config_file()
        self.assertEqual(config['plotly_domain'], 'https://plot.ly')
        self.assertEqual(config['plotly_streaming_domain'], 'stream.plot.ly')
Beispiel #5
0
    def test_reset_config_file(self):

        # Check reset_config and get_config return the same values

        tools.reset_config_file()
        config = tools.get_config_file()
        self.assertEqual(config['plotly_domain'], 'https://plot.ly')
        self.assertEqual(config['plotly_streaming_domain'], 'stream.plot.ly')
Beispiel #6
0
    def test_session_plot_option(self):

        # Check if the session_plot_option and config_plot_optin return the
        # same value

        readable = False
        tools.set_config_file(world_readable=readable)
        session_plot_option = session.get_session_plot_options()
        self.assertEqual(session_plot_option['world_readable'], readable)
        tools.reset_config_file()
Beispiel #7
0
    def test_session_plot_option(self):

        # Check if the session_plot_option and config_plot_optin return the
        # same value

        readable = False
        tools.set_config_file(world_readable=readable)
        session_plot_option = session.get_session_plot_options()
        self.assertEqual(session_plot_option['world_readable'], readable)
        tools.reset_config_file()
    def test_set_config_file_two_entries(self):

        # Check set_config and get_config given only two entries return the
        # same values

        domain, streaming_domain = 'this', 'thing'
        tools.set_config_file(plotly_domain=domain,
                              plotly_streaming_domain=streaming_domain)
        config = tools.get_config_file()
        self.assertEqual(config['plotly_domain'], domain)
        self.assertEqual(config['plotly_streaming_domain'], streaming_domain)
        tools.reset_config_file()
Beispiel #9
0
    def test_set_config_file_two_entries(self):

        # Check set_config and get_config given only two entries return the
        # same values

        domain, streaming_domain = 'this', 'thing'
        tools.set_config_file(plotly_domain=domain,
                              plotly_streaming_domain=streaming_domain)
        config = tools.get_config_file()
        self.assertEqual(config['plotly_domain'], domain)
        self.assertEqual(config['plotly_streaming_domain'], streaming_domain)
        tools.reset_config_file()
Beispiel #10
0
def test_set_config_file():
    pd, ps = 'this', 'thing'
    ssl_verify, proxy_auth = True, True
    tls.set_config_file(plotly_domain=pd, plotly_streaming_domain=ps,
                        plotly_ssl_verification=ssl_verify,
                        plotly_proxy_authorization=proxy_auth)
    config = tls.get_config_file()
    assert config['plotly_domain'] == pd
    assert config['plotly_streaming_domain'] == ps
    assert config['plotly_ssl_verification'] == ssl_verify
    assert config['plotly_proxy_authorization'] == proxy_auth
    tls.reset_config_file()  # else every would hate me :)
Beispiel #11
0
    def test_set_config_file_all_entries(self):

        # Check set_config and get_config return the same values

        domain, streaming_domain, api = 'this', 'thing', 'that'
        ssl_verify, proxy_auth, readable = True, True, True
        tools.set_config_file(plotly_domain=domain,
                              plotly_streaming_domain=streaming_domain,
                              plotly_api_domain=api,
                              plotly_ssl_verification=ssl_verify,
                              plotly_proxy_authorization=proxy_auth,
                              world_readable=readable)
        config = tools.get_config_file()
        self.assertEqual(config['plotly_domain'], domain)
        self.assertEqual(config['plotly_streaming_domain'], streaming_domain)
        self.assertEqual(config['plotly_api_domain'], api)
        self.assertEqual(config['plotly_ssl_verification'], ssl_verify)
        self.assertEqual(config['plotly_proxy_authorization'], proxy_auth)
        self.assertEqual(config['world_readable'], readable)
        tools.reset_config_file()
Beispiel #12
0
    def test_set_config_file_all_entries(self):

        # Check set_config and get_config return the same values

        domain, streaming_domain, api = 'this', 'thing', 'that'
        ssl_verify, proxy_auth, readable = True, True, True
        tools.set_config_file(plotly_domain=domain,
                              plotly_streaming_domain=streaming_domain,
                              plotly_api_domain=api,
                              plotly_ssl_verification=ssl_verify,
                              plotly_proxy_authorization=proxy_auth,
                              world_readable=readable)
        config = tools.get_config_file()
        self.assertEqual(config['plotly_domain'], domain)
        self.assertEqual(config['plotly_streaming_domain'], streaming_domain)
        self.assertEqual(config['plotly_api_domain'], api)
        self.assertEqual(config['plotly_ssl_verification'], ssl_verify)
        self.assertEqual(config['plotly_proxy_authorization'], proxy_auth)
        self.assertEqual(config['world_readable'], readable)
        tools.reset_config_file()
def test_reset_config_file():
    tls.reset_config_file()
    config = tls.get_config_file()
    assert config['plotly_domain'] == 'https://plot.ly'
    assert config['plotly_streaming_domain'] == 'stream.plot.ly'