<commit_before><commit_msg>Some more interface tests<commit_after>import os
import pytest

from sigopt.interface import Connection
from sigopt.resource import ApiResource

class TestInterface(object):
  def test_create(self):
    conn = Connection(client_token='<PASSWORD>')
    conn.set_api_url('https://api-test.sigopt.com')
    assert isinstance(conn.clients, ApiResource)
    assert isinstance(conn.experiments, ApiResource)

  def test_environment_variable(self):
    os.environ['SIGOPT_API_TOKEN'] = '<PASSWORD>'
    Connection()
    del os.environ['SIGOPT_API_TOKEN']

  def test_error(self):
    with pytest.raises(ValueError):
      Connection()

{'fraction_non_alphanumeric': 0.10687022900763359, 'fraction_numerical': 0.0, 'mean_word_length': 5.3076923076923075, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2062260', 'n_tokens_mistral': 197, 'n_tokens_neox': 203, 'n_words': 40}