<commit_before>var lib = require("__buttercup/module.js"),
	encoding = require("__buttercup/tools/encoding.js"),
	entryTools = require("__buttercup/tools/entry.js"),
	Archive = lib.Archive;

module.exports = {

	setUp: function(cb) {
		var archive = new Archive(),
			group = archive.createGroup("test group");
			entry = group.createEntry("My entry");
		entry
			.setProperty("username", "some-user")
			.setProperty("password", "<PASSWORD>")
			.setMeta("accessKey", "12345")
			.setMeta("user prop", "user val")
			.setAttribute("BC_ENTRY_SEQ", "sequence");
		this.id = entry.getID();
		this.entry = entry;
		(cb)();
	},

	deleteMeta: {

		testDeletesProperties: function(test) {
			test.strictEqual(this.entry.getMeta("accessKey"), "12345", "Entry should contain meta item");
			this.entry.deleteMeta("accessKey");
			test.strictEqual(this.entry.getMeta("accessKey"), undefined, "Meta item should be deleted");
			test.done();
		}

	},

	getMeta: {

		testGetsMeta: function(test) {
			test.strictEqual(this.entry.getMeta("accessKey"), "12345", "Entry should contain meta");
			test.strictEqual(this.entry.getMeta("user prop"), "user val", "Entry should contain meta");
			test.done();
		},

		testUnsetReturnsUndefined: function(test) {
			test.strictEqual(this.entry.getMeta("not set"), undefined, "Should return undefined");
			test.done();
		}

	},

	getAttribute: {

		testGetsAttribute: function(test) {
			test.strictEqual(this.entry.getAttribute("BC_ENTRY_SEQ"), "sequence", "Entry should contain attribute");
			test.done();
		},

		testUnsetReturnsUndefined: function(test) {
			test.strictEqual(this.entry.getAttribute("not set"), undefined, "Should return undefined");
			test.done();
		}

	},

	getProperty: {

		testGetsProperties: function(test) {
			test.strictEqual(this.entry.getProperty("title"), "My entry", "Should return title");
			test.strictEqual(this.entry.getProperty("username"), "some-user", "Should return username");
			test.strictEqual(this.entry.getProperty("password"), "<PASSWORD>", "Should return password");
			test.done();
		},

		testUnsetReturnsUndefined: function(test) {
			test.strictEqual(this.entry.getProperty("unset"), undefined, "Should return undefined");
			test.done();
		}

	},

	toObject: {

		testTransfersProperties: function(test) {
			var obj = this.entry.toObject();<commit_msg>Tests for display info<commit_after>var lib = require("__buttercup/module.js"),
	encoding = require("__buttercup/tools/encoding.js"),
	entryTools = require("__buttercup/tools/entry.js"),
	Archive = lib.Archive,
	ManagedEntry = lib.ManagedEntry;

module.exports = {

	setUp: function(cb) {
		var archive = new Archive(),
			group = archive.createGroup("test group");
			entry = group.createEntry("My entry");
		entry
			.setProperty("username", "some-user")
			.setProperty("password", "<PASSWORD>")
			.setMeta("accessKey", "12345")
			.setMeta("user prop", "user val")
			.setAttribute(ManagedEntry.Attributes.DisplayType, "credit-card");
		this.id = entry.getID();
		this.entry = entry;
		(cb)();
	},

	deleteMeta: {

		testDeletesProperties: function(test) {
			test.strictEqual(this.entry.getMeta("accessKey"), "12345", "Entry should contain meta item");
			this.entry.deleteMeta("accessKey");
			test.strictEqual(this.entry.getMeta("accessKey"), undefined, "Meta item should be deleted");
			test.done();
		}

	},

	getMeta: {

		testGetsMeta: function(test) {
			test.strictEqual(this.entry.getMeta("accessKey"), "12345", "Entry should contain meta");
			test.strictEqual(this.entry.getMeta("user prop"), "user val", "Entry should contain meta");
			test.done();
		},

		testUnsetReturnsUndefined: function(test) {
			test.strictEqual(this.entry.getMeta("not set"), undefined, "Should return undefined");
			test.done();
		}

	},

	getAttribute: {

		testGetsAttribute: function(test) {
			test.strictEqual(this.entry.getAttribute(ManagedEntry.Attributes.DisplayType), "credit-card", "Entry should contain attribute");
			test.done();
		},

		testUnsetReturnsUndefined: function(test) {
			test.strictEqual(this.entry.getAttribute("not set"), undefined, "Should return undefined");
			test.done();
		}

	},

	getDisplayInfo: {

		testGetsCorrectInfo: function(test) {
			var dInfo = this.entry.getDisplayInfo();
			test.strictEqual(dInfo.title, "Name on card");
			test.strictEqual(dInfo.username, "Card number");
			test.strictEqual(dInfo.password, "<PASSWORD>");
			test.done();
		}

	},

	getProperty: {

		testGetsProperties: function(test) {
			test.strictEqual(this.entry.getProperty("title"), "My entry", "Should return title");
			test.strictEqual(this.entry.getProperty("username"), "some-user", "Should return username");
			test.strictEqual(this.entry.getProperty("password"), "<PASSWORD>", "Should return password");
			test.done();
		},

		testUnsetReturnsUndefined: function(test) {
			test.strictEqual(this.entry.getProperty("unset"), undefined, "Should return undefined");
			test.done();
		}

	},

	toObject: {

		testTransfersProperties: function(test) {
			var obj = this.entry.toObject();
{'fraction_non_alphanumeric': 0.16383062920459043, 'fraction_numerical': 0.00593589236248516, 'mean_word_length': 4.871080139372823, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 8, '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': '2982362', 'n_tokens_mistral': 1784, 'n_tokens_neox': 1567, 'n_words': 298}