This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from models.model import Book | |
class BookDB: | |
ID = 0 | |
def __init__(self): | |
self.books = [] | |
self.insert(Book('Don Quijote de la Mancha', 'Miguel de Cervantes')) | |
self.insert(Book('Romeo y Julieta', 'William Shakespeare')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# books.py | |
__author__ = "Iván Corrales Solera <developer@wesovi.com>" | |
__written_date = "24/04/2016" | |
import falcon | |
import json | |
from database.book import BookDB |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from database.book import BookDB,Book | |
class TestBookDatabase: | |
def setup(self): | |
self.bookDatabaseClient = BookDB() | |
def test_default_database_length(self): | |
assert self.bookDatabaseClient.books.__len__() is 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import falcon | |
from resources.books import BookResource | |
import falcon.testing as testing | |
from falcon import Request,API | |
class TestBookResource(testing.TestBase): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule Mix.Tasks.Elixchool.FileProcessor do | |
use Mix.Task | |
def run(filePath) do | |
case File.read(filePath) do | |
{:ok, body} -> process(body) | |
{:error, reason} -> errorHandler(reason) | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
test_fn = fn | |
(0, 0, _) -> "FizzBuzz" | |
(0, _, _) -> "Fizz" | |
(_, 0, _) -> "Buzz" | |
(_, _, c) -> c | |
end | |
IO.puts test_fn.(0,0,1) | |
IO.puts test_fn.(0,1,1) | |
IO.puts test_fn.(1,0,1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM phusion/baseimage:0.9.8 | |
MAINTAINER Iván Corrales Solera <developer@wesovi.com> | |
EXPOSE 389 | |
ENV HOME /root | |
ENV LDAP_ORGANISATION Wesovi Labs | |
ENV LDAP_DOMAIN wesovilabs.com | |
ENV LDAP_BASE dc=wesovilabs,dc=com | |
ENV LDAP_ROOTPASS s3cr3t | |
ENV LDAP_LOG_LEVEL 256 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mech_list: plain | |
pwcheck_method: saslauthd | |
saslauthd_path: /var/run/saslauthd/mux |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# saslauthd.conf | |
# for pass through authentication with central IT LDAP | |
# connection information (here using SSL, adjust accordingly) | |
ldap_servers: ldap://*******:389/ | |
# where are we looking | |
ldap_search_base: ou=users,cn=ad,cn=Wesovilabs,dc=com | |
ldap_filter: (uid=%u) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
START=yes | |
DESC="SASL Authentication Daemon" | |
NAME="saslauthd" | |
MECHANISMS="ldap" | |
MECH_OPTIONS="" |