How to use expand_files method in prospector

Best Python code snippet using prospector_python

setup.py

Source: setup.py Github

copy

Full Screen

...6# To use a consistent encoding7from codecs import open8from os import path9from os import listdir10def expand_files(d):11 files_list = [path.join(d, f) for f in listdir(d) if path.isfile(path.join(d, f))]12 return files_list13here = path.abspath(path.dirname(__file__))14# Get the long description from the relevant file15with open(path.join(here, 'DESCRIPTION.rst'), encoding='utf-8') as f:16 long_description = f.read()17setup(18 name='jim',19 # Versions should comply with PEP440. For a discussion on single-sourcing20 # the version across setup.py and the project code, see21 # https:/​/​packaging.python.org/​en/​latest/​single_source_version.html22 version='2.0.0',23 description='JIm = Jim Improved, Score Processing System for ATTTC Club',24 long_description=long_description,25 url='http:/​/​bitbucket.com/​tbd',26 author='Ilija Hadzic',27 author_email='ilijahadzic@gmail.com',28 license='MIT',29 # See https:/​/​pypi.python.org/​pypi?%3Aaction=list_classifiers30 classifiers=[31 'Development Status :: 3 - Alpha',32 'Intended Audience :: Tennis Players',33 'Topic :: Applications :: Web',34 'License :: OSI Approved :: MIT License',35 'Programming Language :: Python :: 2',36 'Programming Language :: Python :: 2.6',37 'Programming Language :: Python :: 2.7'38 ],39 keywords='tennis rankings competition database web',40 packages=find_packages(exclude=[]),41 install_requires=['tornado', 'bcrypt', 'python-daemon', 'argparse'],42 package_data={43 'jim': ['jim.cfg']44 },45 data_files=[46 ('var/​jim/​html', expand_files('html')),47 ('var/​jim/​html/​js', expand_files('html/​js')),48 ('var/​jim/​html/​css', expand_files('html/​css')),49 ('var/​jim/​templates', expand_files('templates')),50 ('var/​jim/​certs', expand_files('certs'))51 ],52 entry_points={53 'console_scripts': [54 'jim=jim:main',55 ],56 },...

Full Screen

Full Screen

test_utils.py

Source: test_utils.py Github

copy

Full Screen

...18 assert wildcard_filter(x, 'a?') == ['ab']19 assert wildcard_filter(x, [['a*'], 'b']) == x20 assert wildcard_filter(x, ['*a', '*b']) == x21 assert wildcard_filter(x, ['a', 'b']) == ['a', 'b']22def test_expand_files():23 from pathlib import Path24 from pachypy.utils import expand_files25 mock_dir = lambda glob: os.path.join(os.path.dirname(__file__), 'mock', glob)26 assert len(expand_files(None)) == 027 assert len(expand_files(mock_dir('*.csv'))) == 728 assert len(expand_files(Path(mock_dir('*.csv')))) == 729 assert len(expand_files([mock_dir('list_*.csv'), Path(mock_dir('get_*.csv'))])) == 730def test_invert_dict():31 from pachypy.utils import invert_dict32 assert invert_dict({'a': '1'}) == {'1': ['a']}33 assert invert_dict({'a': '1', 'b': '1'}) == {'1': ['a', 'b']}34 assert invert_dict({'a': '1', 'b': '2'}) == {'1': ['a'], '2': ['b']}35def test_to_timestamp():36 from pachypy.utils import to_timestamp37 assert to_timestamp(0, 0) is None38 assert to_timestamp(1554878996, 0) == pd.Timestamp('2019-04-10 06:49:56', tz='utc')39def test_to_timedelta():40 from pachypy.utils import to_timedelta41 assert to_timedelta(0, 0) == pd.Timedelta(0, unit='s')...

Full Screen

Full Screen

test_io.py

Source: test_io.py Github

copy

Full Screen

...5 expand_files,6 read_sql_file,7 get_expect_file,8)9def test_expand_files():10 files = expand_files([Path("checks/​basic"), Path("checks/​failing")])11 assert len(files) >= 312def test_expand_files_csv():13 files = expand_files([Path("load_data")], extension=".csv")14 assert len(files) >= 315def test_expand_files_empty():16 files = expand_files([Path("load_data")], extension=".sql")17 assert len(files) == 018def test_expand_files_not_existing():19 with pytest.raises(Exception) as e:20 expand_files([Path("checks/​non_existing")])21 assert str(e.value) == f"unexpected path: checks{os.sep}non_existing"22def test_read_sql_file_with_template():23 text = read_sql_file(Path("checks/​templates/​template1.sql"), {})24 assert "{{" not in text25def test_get_expect_file():26 ef = get_expect_file(Path("test_file.sql"))27 assert ef == Path("test_file.csv")28def test_get_expect_file_null():29 p = Path()30 ef = get_expect_file(p)31 assert ef == Path()32def test_get_expect_file_empty():33 p = Path("")34 ef = get_expect_file(p)...

Full Screen

Full Screen

Blogs

Check out the latest blogs from LambdaTest on this topic:

Test Optimization for Continuous Integration

“Test frequently and early.” If you’ve been following my testing agenda, you’re probably sick of hearing me repeat that. However, it is making sense that if your tests detect an issue soon after it occurs, it will be easier to resolve. This is one of the guiding concepts that makes continuous integration such an effective method. I’ve encountered several teams who have a lot of automated tests but don’t use them as part of a continuous integration approach. There are frequently various reasons why the team believes these tests cannot be used with continuous integration. Perhaps the tests take too long to run, or they are not dependable enough to provide correct results on their own, necessitating human interpretation.

A Complete Guide To CSS Houdini

As a developer, checking the cross browser compatibility of your CSS properties is of utmost importance when building your website. I have often found myself excited to use a CSS feature only to discover that it’s still not supported on all browsers. Even if it is supported, the feature might be experimental and not work consistently across all browsers. Ask any front-end developer about using a CSS feature whose support is still in the experimental phase in most prominent web browsers. ????

Different Ways To Style CSS Box Shadow Effects

Have you ever visited a website that only has plain text and images? Most probably, no. It’s because such websites do not exist now. But there was a time when websites only had plain text and images with almost no styling. For the longest time, websites did not focus on user experience. For instance, this is how eBay’s homepage looked in 1999.

Fluent Interface Design Pattern in Automation Testing

Recently, I was going through some of the design patterns in Java by reading the book Head First Design Patterns by Eric Freeman, Elisabeth Robson, Bert Bates, and Kathy Sierra.

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run prospector automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful