<commit_before>import XCTest
import Vapor
import Testing
import Leaf
import LeafProvider

@testable import AdminPanelProvider

class AdminPanelProviderTests: XCTestCase {
    func testBasic() throws {
        let config = PanelConfig(
            panelName: "Admin",
            baseUrl: "127.0.0.1:8080",
            skin: .black,
            isEmailEnabled: false,
            isStorageEnabled: false,
            fromEmail: nil,
            fromName: nil
        )
        let controller = LoginController(
            renderer: LeafTestRenderer(viewsDir: workingDirectory() + "/Resources/Views/"),
            mailgun: nil,
            panelConfig: config
        )
        let response = try controller.landing(
            req: Request(method: .get, uri: "/")
        )
        print("")
    }
}

func testable() throws -> Droplet {
    let config = try Config(arguments: ["vapor", "--env=test"])
    let drop = try Droplet(
        config: config,
        view: CapturingViewRenderer())
    return drop
}

/// View Renderer to use for testing. Captures passed-in arguments.
class CapturingViewRenderer: ViewRenderer {
    var capturedData: ViewData?
    var capturedPath: String?

    var shouldCache = false

    func make(_ path: String, _ data: ViewData) throws -> View {
        self.capturedData = data
        self.capturedPath = path
        return View(data: [])
    }<commit_msg>Updated tests<commit_after>import XCTest
import Vapor
import Testing
import Leaf
import LeafProvider

@testable import AdminPanelProvider

class AdminPanelProviderTests: XCTestCase {
    func testBasic() throws {
        let config = PanelConfig(
            panelName: "Admin",
            baseUrl: "127.0.0.1:8080",
            skin: .black,
            isEmailEnabled: false,
            isStorageEnabled: false,
            fromEmail: nil,
            fromName: nil
        )
        let controller = LoginController(
            renderer: LeafTestRenderer(viewsDir: workingDirectory() + "/Resources/Views/"),
            mailer: nil,
            panelConfig: config
        )
        let response = try controller.landing(
            req: Request(method: .get, uri: "/")
        )
    }
}

func testable() throws -> Droplet {
    let config = try Config(arguments: ["vapor", "--env=test"])
    let drop = try Droplet(
        config: config,
        view: CapturingViewRenderer())
    return drop
}

/// View Renderer to use for testing. Captures passed-in arguments.
class CapturingViewRenderer: ViewRenderer {
    var capturedData: ViewData?
    var capturedPath: String?

    var shouldCache = false

    func make(_ path: String, _ data: ViewData) throws -> View {
        self.capturedData = data
        self.capturedPath = path
        return View(data: [])
    }
{'fraction_non_alphanumeric': 0.09382894261999278, 'fraction_numerical': 0.007217610970768676, 'mean_word_length': 2.2270081490104774, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '7657850', 'n_tokens_mistral': 773, 'n_tokens_neox': 741, 'n_words': 222}