def test_css(Chart):
 css = '{{ id }}text { fill: #bedead; }\n'
 with NamedTemporaryFile('w') as f:
  f.write(css)
  f.flush()
  config = Config()
  config.css.append(('file://' + f.name))
  chart = Chart(config)
  chart.add('/', [10, 1, 5])
  svg = chart.render().decode('utf-8')
  assert ('#bedead' in svg)
  chart = Chart(css=(_ellipsis, ('file://' + f.name)))
  chart.add('/', [10, 1, 5])
  svg = chart.render().decode('utf-8')
  assert ('#bedead' in svg)

def test_css ( Chart ) : css = '{{ id }}text { fill: #bedead; }\n' with NamedTemporaryFile ( 'w' ) as f : f . write ( css ) f . flush ( ) config = Config ( ) config . css . append ( ( 'file://' + f . name ) ) chart = Chart ( config ) chart . add ( '/' , [ 10 , 1 , 5 ] ) svg = chart . render ( ) . decode ( 'utf-8' ) assert ( '#bedead' in svg ) chart = Chart ( css = ( _ellipsis , ( 'file://' + f . name ) ) ) chart . add ( '/' , [ 10 , 1 , 5 ] ) svg = chart . render ( ) . decode ( 'utf-8' ) assert ( '#bedead' in svg )
test css file option .