<commit_before>var assert = require('assert');
var apkPath = require('../src/apkPath');

describe('apkPath', function() {
    before(function(){
        settings = {}
        settings.download_path = process.cwd() + '\\test\\downloads';
    });

	it('obtain works with correct input', function() {
    	apkPath.obtain('https://correctUrl.com/test/apk/applicationName.apk',function(err,appPath){
            assert(!err,err)
            assert(appPath,'returned appPath was empty')
            assert(appPath.endsWith('applicationName.apk'),'returned appPath had different app name' + appPath)
       });
    });
    it('obtain doesn\'t work when there is no url', function() {
    	assert.throws(function(){ 
    		apkPath.obtain(null) 
    	}, Error,'obtainAPKpath allowed a link without \'https://\'');
    	assert.throws(function(){ 
    		apkPath.obtain('') 
    	}, Error,'obtainAPKpath allowed a link without \'https://\'');
    });
    it('obtain doesn\'t work when there is apk file in the path', function() {
    	assert.throws(function(){ 
    		apkPath.obtain('https://url.com/test/apk/applicationName.rar') 
    	}, Error,'obtainAPKpath allowed a path with no .apk');
    });
});<commit_msg>added string test<commit_after>var assert = require('assert');
var apkPath = require('../src/apkPath');

describe('apkPath', function() {
    before(function(){
        settings = {}
        settings.download_path = process.cwd() + '\\test\\downloads';
    });

	it('obtain works with correct input', function() {
    	apkPath.obtain('https://correctUrl.com/test/apk/applicationName.apk',function(err,appPath){
            assert(!err,err)
            assert(appPath,'returned appPath was empty')
            assert(typeof(appPath) == 'string', "returned app path was not a string but " + typeof(appPath))
            assert(appPath.endsWith('applicationName.apk'),'returned appPath had different app name' + appPath)
       });
    });
    it('obtain doesn\'t work when there is no url', function() {
    	assert.throws(function(){ 
    		apkPath.obtain(null) 
    	}, Error,'obtainAPKpath allowed a link without \'https://\'');
    	assert.throws(function(){ 
    		apkPath.obtain('') 
    	}, Error,'obtainAPKpath allowed a link without \'https://\'');
    });
    it('obtain doesn\'t work when there is apk file in the path', function() {
    	assert.throws(function(){ 
    		apkPath.obtain('https://url.com/test/apk/applicationName.rar') 
    	}, Error,'obtainAPKpath allowed a path with no .apk');
    });
});
{'fraction_non_alphanumeric': 0.16355696705041683, 'fraction_numerical': 0.0, 'mean_word_length': 3.1379310344827585, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 8, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6397595', 'n_tokens_mistral': 797, 'n_tokens_neox': 754, 'n_words': 169}