Пример #1
0
#from src.twitter import Twitter        # Import Class: Twitter
from src.instagram import Instagram  # Import Class: Instagram
from src.classify import classify  # Import Class: classify

if __name__ == '__main__':
    print("Starting Social Media Scrapper...")
    insta_tag = str(input('What hastag would you like to search for: '))
    num_pics = int(
        input('Number of pictures you would like to search (int):  '))
    insta = Instagram(insta_tag, num_pics)
    print("Starting Instagram Scrapper")
    insta.Tag_Scrapper()
    print("Starting Classification of Images")
    classify = classify(insta_tag)
    classify.process()
Пример #2
0
def test_classify_return_None(input, expect):
    result = classify(input)
    assert result == expect
Пример #3
0
def test_non_int_arguments():
	"""test string cases"""
	with pytest.raises(InvalidData):
		obj = classify()
		obj.get_classification('12254943')
Пример #4
0
from src.classify import classify
import argparse

if __name__ == '__main__':
	my_parser = argparse.ArgumentParser(description='list the product description for given product_id')
	my_parser.add_argument('product_id',
							metavar='product_id',
							type=int,
							help='product_id for description')
	args = my_parser.parse_args()
	product_id = args.product_id
	obj = classify()
	print(obj.get_classification(product_id))
Пример #5
0
def test_product_ids(example_input, expectation):
    """test for multiple cases"""
    with expectation:
        obj = classify()
        assert obj.get_classification(example_input) is not None