Пример #1
0
 def setup(self):
     self.config = get_config()
     self.action_space = ActionSpace(get_push_groups())
     self.client_environment = get_random_client_environment()
     self.policy = Policy(self.action_space)
     applied = True
     while applied:
         applied = self.policy.apply_action(self.action_space.sample())
Пример #2
0
def test_get_chrome_command():
    user_data_dir = "/tmp/chrome_data"
    url = "http://example.com"
    flags = get_chrome_flags(user_data_dir)
    config = get_config()
    chrome_cmd = get_chrome_command(url, flags, config)
    assert config.chrome_bin == chrome_cmd[0]
    assert flags == chrome_cmd[1:-1]
    assert url == chrome_cmd[-1]
Пример #3
0
 def setup(self):
     self.config = get_config()
Пример #4
0
 def get_analyzer(self, reward_func: int = 0):
     return Analyzer(get_config(), reward_func, self.client_environment)
Пример #5
0
 def setup(self):
     self.config = get_config()
     self.policy = Policy(ActionSpace(self.config.env_config.push_groups))
     self.client_environment = get_random_client_environment()
Пример #6
0
 def setup(self):
     self.config = get_config()
     self.har = har_from_json(get_har_json())