<commit_before>#!/usr/bin/env python

from nose.tools import *
from subprocess import Popen, PIPE, STDOUT
import os

import os, sys, glob, mapnik

def test_mapnik_config_no_args():
    process = Popen('mapnik-config', shell=True, stdin=PIPE, stdout=PIPE, stderr=PIPE)
    result = process.communicate()
    eq_(process.returncode,1)
    eq_('Usage: mapnik-config ' in result[0],True)
    eq_(result[1],'')

def test_mapnik_config_help():
    process = Popen('mapnik-config --help', shell=True, stdin=PIPE, stdout=PIPE, stderr=PIPE)
    result = process.communicate()
    eq_(process.returncode,0)
    eq_('Usage: mapnik-config ' in result[0],True)
    eq_(result[1],'')

def test_mapnik_config_help_short():
    process = Popen('mapnik-config -h', shell=True, stdin=PIPE, stdout=PIPE, stderr=PIPE)
    result = process.communicate()
    eq_(process.returncode,0)
    eq_('Usage: mapnik-config ' in result[0],True)
    eq_(result[1],'')

def test_mapnik_config_valid_opts():
    valid_args = [
      '-h',
      '--help',
      '-v',
      '--version',
      '--git-revision',
      '--git-describe',
      '--fonts',
      '--input-plugins',
      '--defines',
      '--prefix',
      '--lib-name',
      '--libs',
      '--dep-libs',
      '--ldflags',
      '--includes',
      '--dep-includes',
      '--cxxflags',
      '--cflags',
      '--all-flags'
    ]
    for item in valid_args:
        cmd = 'mapnik-config ' + item
        process = Popen(cmd, shell=True, stdin=PIPE, stdout=PIPE, stderr=PIPE)<commit_msg>remove not yet implemented flag<commit_after>#!/usr/bin/env python

from nose.tools import *
from subprocess import Popen, PIPE, STDOUT
import os

import os, sys, glob, mapnik

def test_mapnik_config_no_args():
    process = Popen('mapnik-config', shell=True, stdin=PIPE, stdout=PIPE, stderr=PIPE)
    result = process.communicate()
    eq_(process.returncode,1)
    eq_('Usage: mapnik-config ' in result[0],True)
    eq_(result[1],'')

def test_mapnik_config_help():
    process = Popen('mapnik-config --help', shell=True, stdin=PIPE, stdout=PIPE, stderr=PIPE)
    result = process.communicate()
    eq_(process.returncode,0)
    eq_('Usage: mapnik-config ' in result[0],True)
    eq_(result[1],'')

def test_mapnik_config_help_short():
    process = Popen('mapnik-config -h', shell=True, stdin=PIPE, stdout=PIPE, stderr=PIPE)
    result = process.communicate()
    eq_(process.returncode,0)
    eq_('Usage: mapnik-config ' in result[0],True)
    eq_(result[1],'')

def test_mapnik_config_valid_opts():
    valid_args = [
      '-h',
      '--help',
      '-v',
      '--version',
      '--git-revision',
      '--git-describe',
      '--fonts',
      '--input-plugins',
      '--defines',
      '--prefix',
      '--lib-name',
      '--libs',
      '--dep-libs',
      '--ldflags',
      '--includes',
      '--dep-includes',
      '--cxxflags',
      '--cflags'
    ]
    for item in valid_args:
        cmd = 'mapnik-config ' + item
        process = Popen(cmd, shell=True, stdin=PIPE, stdout=PIPE, stderr=PIPE)
{'fraction_non_alphanumeric': 0.17144741180349488, 'fraction_numerical': 0.005934718100890208, 'mean_word_length': 2.9148387096774195, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, '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': '3507218', 'n_tokens_mistral': 1113, 'n_tokens_neox': 1101, 'n_words': 208}