Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
With tests.
- Loading branch information
Showing
9 changed files
with
125 additions
and
26 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
class ColdBrewCompileError(SyntaxError): | ||
pass | ||
def __init__(self, location, error): | ||
self.coffee_error_location = location | ||
self.error = error | ||
super(ColdBrewCompileError, self).__init__('Compiling %s \n\n %s' % (location, error)) |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import logging | ||
|
||
class MockLoggingHandler(logging.Handler): | ||
"""Mock logging handler to check for expected logs.""" | ||
|
||
def __init__(self, *args, **kwargs): | ||
self.reset() | ||
logging.Handler.__init__(self, *args, **kwargs) | ||
|
||
def emit(self, record): | ||
self.messages[record.levelname.lower()].append(record.getMessage()) | ||
|
||
def reset(self): | ||
self.messages = { | ||
'debug': [], | ||
'info': [], | ||
'warning': [], | ||
'error': [], | ||
'critical': [], | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
{% load coldbrew %} | ||
{% coffeescript "scripts/test-error.coffee" %} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{% load coldbrew %} | ||
|
||
|
||
{% inlinecoffeescript %} | ||
|
||
console.log "Hello, World" | ||
world = "hello" | ||
mojo = "bad" | ||
|
||
{% endinlinecoffeescript %} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
world = "hello" | ||
mojo = "bad" # Bad indentation |
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
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