<commit_before>﻿using System.Diagnostics;
using System.IO;
using Bloom;
using Bloom.CLI;
using BloomTemp;
using NUnit.Framework;


namespace BloomTests.CLI
{
	[TestFixture]
	public class HydrateBookCommandTests
	{
		private string _originalHtmlPath;
		private string _eventualHtmlPath;
		private TemporaryFolder _testFolder;
		private TemporaryFolder _bookFolder;

		[SetUp]
		public void Setup()
		{
			_testFolder = new TemporaryFolder("hydration test");
			_bookFolder = new TemporaryFolder(_testFolder,"original name");
			_originalHtmlPath = _bookFolder.Combine("original name.html");
			// We need the reference to basic book.css because that's where the list of valid page layouts lives,
			// and Bloom will force the book to A5Portrait if it can't verify that A5Landscape, Device16x9Landscape etc. are valid.
			File.WriteAllText(_originalHtmlPath,
				@"<html><head><link rel='stylesheet' href='Basic Book.css' type='text / css'></link></head><body>
					< div id='bloomDataDiv'>
						<div data-book='bookTitle' lang='en'>
								mudmen<commit_msg>Remove superfluous whitespace causing test to fail<commit_after>﻿using System.Diagnostics;
using System.IO;
using Bloom;
using Bloom.CLI;
using BloomTemp;
using NUnit.Framework;


namespace BloomTests.CLI
{
	[TestFixture]
	public class HydrateBookCommandTests
	{
		private string _originalHtmlPath;
		private string _eventualHtmlPath;
		private TemporaryFolder _testFolder;
		private TemporaryFolder _bookFolder;

		[SetUp]
		public void Setup()
		{
			_testFolder = new TemporaryFolder("hydration test");
			_bookFolder = new TemporaryFolder(_testFolder,"original name");
			_originalHtmlPath = _bookFolder.Combine("original name.html");
			// We need the reference to basic book.css because that's where the list of valid page layouts lives,
			// and Bloom will force the book to A5Portrait if it can't verify that A5Landscape, Device16x9Landscape etc. are valid.
			File.WriteAllText(_originalHtmlPath,
				@"<html><head><link rel='stylesheet' href='Basic Book.css' type='text / css'></link></head><body>
					<div id='bloomDataDiv'>
						<div data-book='bookTitle' lang='en'>
								mudmen
{'fraction_non_alphanumeric': 0.09647495361781076, 'fraction_numerical': 0.00463821892393321, 'mean_word_length': 4.798387096774194, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, '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': '3129070', 'n_tokens_mistral': 730, 'n_tokens_neox': 635, 'n_words': 191}