<commit_before>package access_log

import (
	. "launchpad.net/gocheck"
	"github.com/cloudfoundry/gorouter/config"
)

type CreateRunningAccessLoggerSuite struct{}
var _ = Suite(&CreateRunningAccessLoggerSuite{})

func (s *CreateRunningAccessLoggerSuite) TestProxyHasNoAccessLoggerIfNoAccesLogAndNoLoggregatorUrl(c *C) {
	config := config.DefaultConfig()
	c.Assert(CreateRunningAccessLogger(config), IsNil)
}

func (s *CreateRunningAccessLoggerSuite) TestProxyHasAccessLoggerIfNoAccesLogButLoggregatorUrl(c *C) {
	config := config.DefaultConfig()
	config.LoggregatorConfig.Url = "10.10.3.13:4325"
	config.AccessLog = ""
	c.Assert(CreateRunningAccessLogger(config), NotNil)
}

func (s *CreateRunningAccessLoggerSuite) TestProxyHasAccessLoggerIfAccesLogButNoLoggregatorUrl(c *C) {
	config := config.DefaultConfig()
	config.AccessLog = "/dev/null"
	c.Assert(CreateRunningAccessLogger(config), NotNil)
}

func (s *CreateRunningAccessLoggerSuite) TestProxyHasAccessLoggerIfBothAccesLogAndLoggregatorUrl(c *C) {
	config := config.DefaultConfig()
	config.LoggregatorConfig.Url = "10.10.3.13:4325"
	config.AccessLog = "/dev/null"
	c.Assert(CreateRunningAccessLogger(config), NotNil)
}

func (s *CreateRunningAccessLoggerSuite) TestProxyPanicsIfInvalidAccessLogLocation(c *C) {
	config := config.DefaultConfig()
	config.AccessLog = "/this\\should/panic"
	c.Assert(func() {
			CreateRunningAccessLogger(config)
		}, PanicMatches, "open /this\\\\should/panic: no such file or directory")
}<commit_msg>Rename tests to match function being tested<commit_after>package access_log

import (
	. "launchpad.net/gocheck"
	"github.com/cloudfoundry/gorouter/config"
)

type CreateRunningAccessLoggerSuite struct{}
var _ = Suite(&CreateRunningAccessLoggerSuite{})

func (s *CreateRunningAccessLoggerSuite) TestDoesNotCreateAnAccessLoggerIfNoAccesLogAndNoLoggregatorUrl(c *C) {
	config := config.DefaultConfig()
	c.Assert(CreateRunningAccessLogger(config), IsNil)
}

func (s *CreateRunningAccessLoggerSuite) TestCreatesAnAccessLoggerIfNoAccesLogButLoggregatorUrl(c *C) {
	config := config.DefaultConfig()
	config.LoggregatorConfig.Url = "10.10.3.13:4325"
	config.AccessLog = ""
	c.Assert(CreateRunningAccessLogger(config), NotNil)
}

func (s *CreateRunningAccessLoggerSuite) TestCreatesAnAccessLoggerIfAccesLogButNoLoggregatorUrl(c *C) {
	config := config.DefaultConfig()
	config.AccessLog = "/dev/null"
	c.Assert(CreateRunningAccessLogger(config), NotNil)
}

func (s *CreateRunningAccessLoggerSuite) TestCreatesAnAccessLoggerIfBothAccesLogAndLoggregatorUrl(c *C) {
	config := config.DefaultConfig()
	config.LoggregatorConfig.Url = "10.10.3.13:4325"
	config.AccessLog = "/dev/null"
	c.Assert(CreateRunningAccessLogger(config), NotNil)
}

func (s *CreateRunningAccessLoggerSuite) TestPanicsIfInvalidAccessLogLocation(c *C) {
	config := config.DefaultConfig()
	config.AccessLog = "/this\\should/panic"
	c.Assert(func() {
			CreateRunningAccessLogger(config)
		}, PanicMatches, "open /this\\\\should/panic: no such file or directory")
}
{'fraction_non_alphanumeric': 0.1163177135260884, 'fraction_numerical': 0.014622798271851114, 'mean_word_length': 7.337950138504155, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 4, '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': '5928495', 'n_tokens_mistral': 1007, 'n_tokens_neox': 971, 'n_words': 154}